Background: Patients with attention-deficit/hyperactivity disorder (ADHD) are at increased risk of seizures. Stimulant medications such as methylphenidate are the most commonly prescribed treatment for ADHD, but the association between their therapeutic use and the risk of seizures is unclear. This study aims to investigate the association between methylphenidate treatment and the risk of seizure in patients with ADHD. Methods: We conducted an observational study using population-based, electronic medical record database from the Hong Kong Clinical Data Analysis & Reporting System to identify individuals aged 6 to 25 years who were treated with methylphenidate between January 1, 2001, and December 31, 2017. Patients treated with methylphenidate who had seizures were included in the subsequent analyses and a self-controlled case series design was used to control for time-invariant patient characteristics. Additional analysis was conducted using skin infection as a negative control outcome. Relative incidence of seizure during periods when patients were exposed to methylphenidate was compared with non-exposed periods. Findings: Among 29,604 patients prescribed methylphenidate, 269 had incident seizures during the study period. The mean (SD) age at baseline was 6•66 (2•01) years and 199 (74•0%) were male. The overall incidence of seizure during methylphenidate treatment was 4•4 per 10 000 patient-years. An increased risk of seizure was detected during the 30-day period following initiation of methylphenidate compared to nonexposed periods, with an incidence rate ratio (IRR) of 4•01 (95% CI, 2•09-7•68). No increase in risk was identified during the 31 to 180 days of the treatment (IRR, 1•13; 95% CI, 0•56-2•25) or during subsequent treatment (IRR, 1•38; 95% CI, 0•92-2•07). No increased risk was identified in all risk windows for the negative control outcome analysis. No patient died due to seizure. Interpretation: The incidence of seizures was higher in the period immediately after the start of the methylphenidate treatment compared to the non-exposed period. The risk returned to baseline levels during continuation of methylphenidate treatment. The association between methylphenidate treatment and seizures immediately following initiation of medication can be seen as a potential safety signal. Monitoring of 5 neurological outcomes in methylphenidate users is essential when they first start on medication is recommended.