Adult-onset seizure reflects the burden of acquired brain insults, but established disease-modifying preventive strategies are limited. We evaluated whether semaglutide initiation is associated with a lower incidence of adult-onset seizure compared to sodium-glucose cotransporter 2 (SGLT2) inhibitors and other glucose-lowering drugs (GLDs) in adults with type 2 diabetes. Using the All of Us Research Program, we emulated a population-based target trial in new-user, active-comparator cohorts from January 2018 to October 2023. We compared semaglutide versus other GLDs and semaglutide versus SGLT2 inhibitors. Incident epilepsy or seizure was identified from diagnostic codes. Effects were estimated using inverse probability of treatment weighting (IPTW) with weighted Cox models and targeted maximum likelihood estimation (TMLE). Subgroup and sensitivity analyses with multiple outcome definitions and analytic approaches were conducted to assess the robustness of findings. We evaluated mediation through hemoglobin A1c (HbA1c) and body mass index (BMI) using the longitudinal Vansteelandt framework. We analyzed 10,213 patients in the semaglutide (n=2,586, mean age, 60.1 years; 56.8% female) versus other GLDs cohort (n=7,627, mean age, 63.7 years; 54.2% female) and 8,605 patients in the semaglutide (n=2,814, mean age, 60.5 years; 66.2% female) versus SGLT2i cohort (n=5,791, mean age, 64.4 years; 47.3% female). Semaglutide was associated with a lower risk of adult-onset seizure compared to other GLDs (weighted HR, 0.44 [95% CI, 0.25-0.79]; 4-year risk difference, −1.78% [95% CI, −2.58 to −0.98]) and SGLT2i (weighted HR, 0.48 [95% CI, 0.27-0.85]; 4-year risk difference, -1.46% [95% CI, −2.41 to −0.51]). TMLE estimated risk differences per 1,000 persons of −14.20 (95% CI, −18.33 to −10.07) versus other GLDs and −7.62 (95% CI, −11.65 to −3.60) versus SGLT2i, corresponding to numbers needed to treat of 70 and 131, respectively. Mediation was minimal for HbA1c (2.4% vs other GLDs; 6.5% vs SGLT2i) and BMI (0% vs other GLDs; 0.7% vs SGLT2i). Semaglutide initiation was associated with a lower risk of adult-onset seizure compared to SGLT2i and other GLDs in patients with type 2 diabetes, independent of glycemic and weight effects. Residual confounding, low event counts, and shorter follow-up limit causal interpretation. This study provides Class II evidence that semaglutide use was associated with a lower risk of adult-onset seizures compared to other glucose lowering drugs and sodium-glucose cotransporter-2 inhibitors.