Aims/hypothesisSeveral studies have identified associations between type 2 diabetes and DNA methylation (DNAm). However, the causal role of these associations remains unclear. This study aimed to provide evidence for a causal relationship between DNAm and type 2 diabetes.MethodsWe used bidirectional two-sample Mendelian randomisation (2SMR) to evaluate causality at 58 CpG sites previously detected in a meta-analysis of epigenome-wide association studies (meta-EWAS) of prevalent type 2 diabetes in European populations. We retrieved genetic proxies for type 2 diabetes and DNAm from the largest genome-wide association study (GWAS) available. We also used data from the Avon Longitudinal Study of Parents and Children (ALSPAC, UK) when associations of interest were not available in the larger datasets. We identified 62 independent SNPs as proxies for type 2 diabetes, and 39 methylation quantitative trait loci as proxies for 30 of the 58 type 2 diabetes-related CpGs. We applied the Bonferroni correction for multiple testing and inferred causality based onp<0.001 for the type 2 diabetes to DNAm direction andp<0.002 for the opposing DNAm to type 2 diabetes direction in the 2SMR analysis.ResultsWe found strong evidence of a causal effect of DNAm at cg25536676 (DHCR24) on type 2 diabetes. An increase in transformed residuals of DNAm at this site was associated with a 43% (OR 1.43, 95% CI 1.15, 1.78,p=0.001) higher risk of type 2 diabetes. We inferred a likely causal direction for the remaining CpG sites assessed. In silico analyses showed that the CpGs analysed were enriched for expression quantitative trait methylation sites (eQTMs) and for specific traits, dependent on the direction of causality predicted by the 2SMR analysis.Conclusions/interpretationWe identified one CpG mapping to a gene related to the metabolism of lipids (DHCR24) as a novel causal biomarker for risk of type 2 diabetes. CpGs within the same gene region have previously been associated with type 2 diabetes-related traits in observational studies (BMI, waist circumference, HDL-cholesterol, insulin) and in Mendelian randomisation analyses (LDL-cholesterol). Thus, we hypothesise that our candidate CpG inDHCR24may be a causal mediator of the association between known modifiable risk factors and type 2 diabetes. Formal causal mediation analysis should be implemented to further validate this assumption.Graphical AbstractSupplementary InformationThe online version of this article (10.1007/s00125-023-05914-7) contains peer-reviewed but unedited supplementary material.