BackgroundHigher vitamin D concentrations and grip strength contribute to lower individual-level risk of dementia, while apolipoprotein 4 (APOE e4) genotype carries increases dementia risk, but whether combination of ideal vitamin D and grip strength counteracts the risk effect of dementia related to APOE e4 genotype remains unclear. We aimed to investigate the interactions between vitamin D/grip strength and APOE e4 genotype and their association with dementia.MethodsThe UK Biobank cohort comprised 165,688 dementia-free participants (aged at least 60 years) for the dementia analysis. Dementia was ascertained using hospital inpatient, mortality, and self-reported data until 2021. Vitamin D and grip strength were collected at baseline and divided into tertiles. APOE genotype was coded as APOE e4 non-carries and APOE e4 carries. Data were analyzed using Cox proportional hazard models and restricted cubic regression splines, with adjusted for known confounders.ResultsOver the follow-up (median: 12.0 years), 3917 participants developed dementia. In women and men, respectively, compared with to the lowest tertile of vitamin D, the HRs (95% CIs) of dementia were lower in the middle [0.86 (0.76–0.97)/0.80 (0.72–0.90)] and the highest tertile [0.81 (0.72–0.90)/0.73 (0.66–0.81)]. Tertiles of grip strength showed similar patterns. In women and men, respectively, participants who had both highest tertile of vitamin D and grip strength was associated with a lower risk of dementia compared to those with both lowest tertile of these two exposures among APOE e4 genotype carries (HR = 0.56, 95% CI 0.42–0.76, and HR = 0.48, 95% CI 0.36–0.64) and APOE e4 genotype non-carries (HR = 0.56, 95% CI 0.38–0.81, and HR = 0.34, 95% CI 0.24–0.47). There were significant additive interactions between lower vitamin D/grip strength and APOE e4 genotype on dementia among women and men.ConclusionsHigher vitamin D and grip strength were associated with a lower risk of dementia, and seemed to halve the adverse effects of APOE e4 genotype on dementia. Our findings suggested that vitamin D and grip strength may be imperative for estimating the risks of dementia, especially among APOE e4 genotype carries.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12967-023-04195-3.