Migraine is one of the most disabling and prevalent of all disorders. To improve understanding of migraine mechanisms and to suggest a new therapeutic target, we investigated whether opening of ATP-sensitive potassium channels (KATP) would cause migraine attacks. In this randomized, double-blind, placebo-controlled, crossover study, 16 patients aged 18–49 years with one to five migraine attacks a month were randomly allocated to receive an infusion of 0.05 mg/min KATP channel opener levcromakalim and placebo on two different days (ClinicalTrials.gov number, NCT03228355). The primary endpoints were the difference in incidence of migraine attacks, headaches and the difference in area under the curve (AUC) for headache intensity scores (0–12 h) and for middle cerebral artery blood flow velocity (0–2 h) between levcromakalim and placebo. Between 24 May 2017 and 23 November 2017, 16 patients randomly received levcromakalim and placebo on two different days. Sixteen patients (100%) developed migraine attacks after levcromakalim compared with one patient (6%) after placebo (P = 0.0001); the difference of incidence is 94% [95% confidence interval (CI) 78–100%]. The incidence of headache over the 12 h observation period was higher but not significant after levcromakalim (n = 16) than after placebo (n = 7) (P = 0.016) (95% CI 16–71%). The AUC for headache intensity was significantly larger after levcromakalim compared to placebo (AUC0–12h, P < 0.0001). There was no change in mean middle cerebral artery blood flow velocity after levcromakalim compared to placebo (AUC0–2hP = 0.46). Opening of KATP channels caused migraine attacks in all patients. This suggests a crucial role of these channels in migraine pathophysiology and that KATP channel blockers could be potential targets for novel drugs for migraine.