BackgroundResearch on the association of physical activity and sedentary time with dementia is accumulating, though elusive, and the interaction effects of the two remain unclear. We analysed the joint associations of accelerometer-measured physical activity and sedentary time with risk of incident dementia (all-cause dementia, Alzheimer’s disease and vascular dementia).MethodsA total of 90,320 individuals from the UK Biobank were included. Accelerometer-measured total volume of physical activity (TPA) and sedentary time were measured at baseline and dichotomised by median (low TPA [< 27 milli-gravity (milli-g)], high TPA [≥ 27 milli-g]; low sedentary time [< 10.7 h/day], high sedentary time [≥ 10.7 h/day]). Cox proportional hazards models were used to evaluate the joint associations with incident dementia on both additive and multiplicative scales.ResultsDuring a median follow-up of 6.9 years, 501 cases of all-cause dementia were identified. Higher TPA was associated with a lower risk of all-cause dementia, Alzheimer’s disease and vascular dementia; the multivariate adjusted hazard ratios (HRs) (95% CI) per 10 milli-g increase were 0.63 (0.55–0.71), 0.74 (0.60–0.90) and 0.69 (0.51–0.93), respectively. Sedentary time was only found to be linked to all-cause dementia, and the HR for high sedentary time was 1.03 (1.01–1.06) compared with that for low sedentary time. No additive and multiplicative relationship of TPA and sedentary time to incident dementia was found (allPvalues > 0.05).ConclusionHigher TPA level was related to a lower risk of incident dementia irrespective of sedentary time, which highlighted the implication of promoting physical activity participation to counteract the potential detrimental effect of sedentary time on dementia.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12966-023-01464-8.