Objective Epilepsy is a brain condition that causes recurring seizures affecting millions of people worldwide. Accumulating evidences show that hypertension is one causative factor of epilepsy. In present study, we try to reveal the causal relationship between hypertension & epilepsy and the potential mediating role of diabetic retinopathy in epilepsy pathogenesis by performing Mendelian randomization (MR) analysis. Methods Based on Genome-wide association studies (GWAS) data of hypertension(finn-b-I9_HYPTENS), epilepsy(finn-b-G6_EPLEPSY) and diabetic retinopathy (finn-b-DM_RETINOPATHY_EXMORE), we performed a two-step MR analysis to investigate the association between hypertension and epilepsy, as well as the role of diabetic retinopathy traits as mediators. The primary approach utilized for causal analysis is inverse variance weighting (IVW), with the addition of multiple sensitivity analyses to assess the reliability of MR outcomes. Subsequently, the causal association between hypertension and epilepsy was further confirmed by analyzing another epilepsy GWAS database (ebi-a-GCST90018840). Results IVW analysis showed that hypertension was one etiological factor of epilepsy which increased its incidence (IVW odds ratio (OR) = 1.14, 95% confidence interval (CI) = 1.06 to 1.22, P=0.0003). The proportion of genetically predicted hypertension mediated by diabetic retinopathy was 11.5%. Subsequent validation analysis further confirmed correlation between hypertension and epilepsy onset (IVW OR =1.12, 95% CI = 1.04 to 1.20, P= 0.0027). Conclusion Our results for the first time revealed causal effect between hypertension and epilepsy through MR analysis, of which diabetic retinopathy served as one key mediator. This insight broadens our understanding about etiology of epilepsy, and it provides clues for better intervention of epilepsy.