Background High amounts of sedentary behaviour have been associated with increased risks of several chronic conditions and mortality. However, it is unclear whether physical activity attenuates or even eliminates the detrimental effects of prolonged sitting. We examined the associations of sedentary behaviour and physical activity with all-cause mortality. Methods We did a systematic review, searching six databases (PubMed, PsycINFO, Embase, Web of Science, Sport Discus, and Scopus) from database inception until October, 2015, for prospective cohort studies that had individual level exposure and outcome data, provided data on both daily sitting or TV-viewing time and physical activity, and reported effect estimates for all-cause mortality, cardiovascular disease mortality, or breast, colon, and colorectal cancer mortality. We included data from 16 studies, of which 14 were identified through a systematic review and two were additional unpublished studies where pertinent data were available. All study data were analysed according to a harmonised protocol, which categorised reported daily sitting time and TV-viewing time into four standardised groups each, and physical activity into quartiles (in metabolic equivalent of task [MET]-hours per week). We then combined data across all studies to analyse the association of daily sitting time and physical activity with all-cause mortality, and estimated summary hazard ratios using Cox regression. We repeated these analyses using TV-viewing time instead of daily sitting time. Findings Of the 16 studies included in the meta-analysis, 13 studies provided data on sitting time and all-cause mortality. These studies included 1 005 791 individuals who were followed up for 2–18·1 years, during which 84 609 (8·4%) died. Compared with the referent group (ie, those sitting <4 h/day and in the most active quartile [>35·5 MET-h per week]), mortality rates during follow-up were 12–59% higher in the two lowest quartiles of physical activity (from HR=1·12, 95% CI 1·08–1·16, for the second lowest quartile of physical activity [<16 MET-h per week] and sitting <4 h/day; to HR=1·59, 1·52–1·66, for the lowest quartile of physical activity [<2·5 MET-h per week] and sitting >8 h/day). Daily sitting time was not associated with increased all-cause mortality in those in the most active quartile of physical activity. Compared with the referent (<4 h of sitting per day and highest quartile of physical activity [>35·5 MET-h per week]), there was no increased risk of mortality during follow-up in those who sat for more than 8 h/day but who also reported >35·5 MET-h per week of activity (HR=1·04; 95% CI 0·99–1·10). By contrast, those who sat the least (<4 h/day) and were in the lowest activity quartile (<2·5 MET-h per week) had a significantly increased risk of dying during follow-up (HR=1·27, 95% CI 1·22–1·31). Six studies had data on TV-viewing time (N=465 450; 43 740 deaths). Watching TV for 3 h or more per day was associated with increased mortality regardless of physical activity, except in the most active quartile, where mortality was significantly increased only in people who watched TV for 5 h/day or more (HR=1·16, 1·05–1·28). Interpretation High levels of moderate intensity physical activity (ie, about 60–75 min per day) seem to eliminate the increased risk of death associated with high sitting time. However, this high activity level attenuates, but does not eliminate the increased risk associated with high TV-viewing time. These results provide further evidence on the benefits of physical activity, particularly in societies where increasing numbers of people have to sit for long hours for work and may also inform future public health recommendations. Funding None.