ABSTRACTLimited research has investigated the impact of antihypertensive medications on type 2 diabetes mellitus (T2DM) and whether gut microbiome (GM) mediates this association. Thus, we conducted a two‐sample Mendelian randomization (MR) analysis to estimate the potential impact of various antihypertensive drug target genes on T2DM and its complications. Genetic instruments for the expression of antihypertensive drug target genes were identified with expression quantitative trait loci (eQTL) in blood, which should be associated with systolic blood pressure (SBP). Sensitivity analysis, including reverse causality detection, horizontal pleiotropy, phenotype scanning, and Bayesian colocalization, was used to validate our findings. We performed a two‐step MR to detect the mediating role of GM. A 1‐standard deviation (SD) decrease of KCNJ11 (acting on arteriolar smooth muscle, e.g., Pinacidil) gene expression was associated with lower SBP of 1.12 (95% confidence interval [CI], 0.93–1.31) mmHg, and a decreased risk of diabetic retinopathy (odds ratio [OR], 0.63; 95% CI, 0.52–0.76). Similarly, a 1‐SD decrease of SLC12A2 (genetically a proxy for diuretics, for example, Torasemide) gene expression was correlated with a reduced risk of T2DM (OR, 0.88; 95% CI, 0.83–0.92). Interestingly, this causal effect was influenced by a decrease in the gut microbiota abundance of the genus Ruminococcus (effect proportion = 11.2%). Colocalization supports these results (KCNJ11: 98% for diabetic retinopathy; SLC12A2: 99% for T2DM). Findings provide novel targets for the treatment of T2DM and its complications, emphasize the importance of KCNJ11 and SLC12A2 in future drug development, and highlight the significant mediating role of the genus Ruminococcus.