Background: Sphenopalatine ganglion stimulation increased cerebral collateral blood flow, stabilised the blood–brain barrier, and reduced infarct size, in preclinical models of acute ischaemic stroke, and showed potential benefit in a pilot randomised trial in humans. The pivotal ImpACT-24B trial aimed to determine whether sphenopalatine ganglion stimulation 8–24 h after acute ischaemic stroke improved functional outcome. Methods: ImpACT-24B is a randomised, double-blind, sham-controlled, pivotal trial done at 73 centres in 18 countries. It included patients (men aged 40–80 years and women aged 40–85 years) with anterior-circulation acute ischaemic stroke, not undergoing reperfusion therapy. Enrolled patients were randomly assigned via web-based randomisation to receive active sphenopalatine ganglion stimulation (intervention group) or sham stimulation (sham-control group) 8–24 h after stroke onset. Patients, clinical care providers, and all outcome assessors were masked to treatment allocation. The primary efficacy endpoint was the difference between active and sham groups in the proportion of patients whose 3-month level of disability improved above expectations. This endpoint was evaluated in the modified intention-to-treat (mITT) population (defined as all patients who received one active or sham treatment session) and the population with confirmed cortical involvement (CCI) and was analysed using the Hochberg multi-step procedure (significance in both populations if p<0·05 in both, and in one population if p<0·025 in that one). Safety endpoints at 3 months were all serious adverse events (SAEs), SAEs related to implant placement or removal, SAEs related to stimulation, neurological deterioration, and mortality. All patients who underwent an attempted sphenopalatine ganglion stimulator or sham stimulator placement procedure were included in the safety analysis. This trial is registered with ClinicalTrials.gov, number NCT00826059. Findings: Between June 10, 2011, and March 7, 2018, 1078 patients were enrolled and randomly assigned to either the intervention or the sham-control group. 1000 patients received at least one session of sphenopalatine ganglion stimulation or sham stimulation and entered the mITT population (481 [48%] received sphenopalatine ganglion stimulation, 519 [52%] were sham controls), among whom 520 (52%) patients had CCI on imaging. The proportion of patients in the mITT population whose 3-month disability level was better than expected was 49% (234/481) in the intervention group versus 45% (236/519) in the sham-control group (odds ratio 1·14, 95% CI 0·89–1·46; p=0·31). In the CCI population, the proportion was 50% (121/244) in the intervention group versus 40% (110/276) in the sham-control group (1·48, 1·05–2·10; p=0·0258). There was an inverse U-shaped dose–response relationship between attained sphenopalatine ganglion stimulation intensity and the primary outcome in the CCI population: the proportion with favourable outcome increased from 40% to 70% at low–midrange intensity and decreased back to 40% at high intensity stimulation (p=0·0034). There were no differences in mortality or SAEs between the intervention group (n=536) and the sham-control group (n=519) in the safety population. Interpretation: Sphenopalatine ganglion stimulation is safe for patients with acute ischaemic stroke 8–24 h after onset, who are ineligible for thrombolytic therapy. Although not reaching significance, the trial's results support that, among patients with imaging evidence of cortical involvement at presentation, sphenopalatine ganglion stimulation is likely to improve functional outcome. Funding: BrainsGate Ltd.