BackgroundCancer is an age-related condition, but changes to modifiable lifestyle-related behaviours, including physical activity, could impact risk. While step count is an accessible metric of activity for older adults, its association with cancer risk remains poorly understood. We investigated the association between accelerometer-measured total activity, step count, and cancer risk. MethodsWe analysed data from a prospective UK Biobank cohort of consenting participants who wore wrist-based Axivity AX3 accelerometer devices for 7 days between June 1, 2013 and Dec 23, 2015, had valid accelerometer data, and no previous cancer diagnosis at baseline. Machine learning models estimated total physical activity (vector magnitude) and step count. The primary outcome, a composite of 13 cancers previously associated with physical activity, was obtained from national registries. Hazard ratios (HR) and were calculated using Cox proportional hazard models, with attained age as the underlying timescale and adjustment for sex, ethnicity, smoking status, alcohol consumption, education, and Townsend Deprivation Index. The impact of reallocating time between behaviours was evaluated using compositional data analyses. Dose-response associations were assessed with restricted cubic splines. FindingsWe analysed data from 86 556 participants, who were followed up during an average of 6·1 years (age range 43–78; 48 478 [56%] female and 38 078 [44%] male; 83 830 [97%] white). 5577 incident malignant cancers occurred among these 86 556 participants. Greater total physical activity was associated with a lower risk of physical-activity-related cancer (HR per 1 SD [+8·33 milligravity per day] 0·85, 95% CI 0·81–0·89). Reallocating 30 min/day from other activities to moderate-to-vigorous physical activity behaviour was associated with lower cancer risk (HR 0·96, 0·94–0·98), as was reallocating 1 h/day to light intensity activity (HR 0·94, 0·92–0·96), compared with the mean behaviour composition among included participants. Compared with taking 5000 steps per day, taking 10 000 daily steps was associated with a significantly lower risk of physical-activity-related cancer (HR 0·81, 0·73–0·90). InterpretationIn this sample from the UK Biobank, higher total physical activity and daily step count were associated with lower risk of physical-activity-related cancers. Findings suggest additional physical activity time, irrespective of intensity, may be beneficial. Increasing low intensity activity time and increasing daily step counts could be practical public health interventions to lower cancer risk, especially for aging adults. FundingNational Institute of Health Oxford Cambridge Scholars Program, Wellcome Trust, Swiss Re, Health Data Research UK, and Cancer Research UK.