BackgroundMost studies investigating the association between physical activity (PA) and the risk of type 2 diabetes are derived from self-reported questionnaires, with limited evidence using device-based measurements. Therefore, this study aimed to investigate the dose–response relationship between device-measured PA and incident type 2 diabetes.MethodsThis prospective cohort study included 40,431 participants of the UK Biobank. Wrist-worn accelerometers were used to estimate total, light, moderate, vigorous and moderate-to-vigorous PA. The associations between PA and incident type 2 diabetes were analysed using Cox-proportional hazard models. The mediating role of body mass index (BMI) was tested under a causal counterfactual framework.ResultsThe median follow-up period was 6.3 years (IQR: 5.7–6.8), with 591 participants developing type 2 diabetes. Compared to those achieving < 150 min/week of moderate PA, people achieving 150–300, 300–600 and > 600 min/week were at 49% (95% CI 62–32%), 62% (95% CI 71–50%) and 71% (95% CI 80–59%) lower risk of type 2 diabetes, respectively. For vigorous PA, compared to those achieving < 25 min/week, individuals achieving 25–50, 50–75 and > 75 min/week were at 38% (95% CI 48–33%), 48% (95% CI 64–23%) and 64% (95% CI 78–42%) lower type 2 diabetes risk, respectively. Twelve per cent and 20% of the associations between vigorous and moderate PA and type 2 diabetes were mediated by lower BMI, respectively.ConclusionsPA has clear dose-response relationship with a lower risk of type 2 diabetes. Our findings support the current aerobic PA recommendations but suggest that additional PA beyond the recommendations is associated with even greater risk reduction.Trial registrationThe UK Biobank study was approved by the North West Multi-Centre Research Ethics Committee (Ref 11/NW/0382 on June 17, 2011).Supplementary InformationThe online version contains supplementary material available at 10.1186/s12916-023-02851-5.