AimsTo evaluate the potential causal effect of glycemic traits on lung cancer and investigate the impact of antihyperglycemic agent-target genes on lung cancer risk. MethodsGenetic variants associated with glycemic traits, antihyperglycemic agent-target genes, and lung cancer were extracted from the Meta-Analyses of Glucose and Insulin-related traits Consortium (MAGIC), expression quantitative trait loci (eQTLs), protein quantitative trait loci (pQTLs), and the International Lung Cancer Consortium (ILCCO), respectively. Mendelian randomization (MR) analyses were performed to examine the associations of glycemic traits and antihyperglycemic agent-target genes with lung cancer. Mediation analysis was conducted to explore whether overweight operated as a mediator between antihyperglycemic agents and lung cancer outcomes. ResultsGenetically determined glycated hemoglobin A1c levels were associated with squamous cell lung cancer (OR = 1.78; 95 % CI, 1.08–2.92; p = 0.023). The PRKAB1 gene (the target of metformin) was associated with a lower risk of developing lung adenocarcinoma (OR = 0.85; 95 % CI, 0.76–0.96; p = 0.006). Further mediation analyses did not support overweight as a mediator between PRKAB1 activation and lung adenocarcinoma. ConclusionOur analyses suggest an association of genetically determined abnormal glycemic traits with squamous cell lung cancer. The potential association between PRKAB1 activation and a reduced risk of developing lung adenocarcinoma appears to be independent of the anti-obesity effects of metformin, suggesting that PRKAB1 activation may have a direct protective effect on lung adenocarcinoma development.