Background: Placement of an interatrial shunt device reduces pulmonary capillary wedge pressure during exercise in patients with heart failure and preserved or mildly reduced ejection fraction. We aimed to investigate whether an interatrial shunt can reduce heart failure events or improve health status in these patients. Methods: In this randomised, international, blinded, sham-controlled trial performed at 89 health-care centres, we included patients (aged ≥40 years) with symptomatic heart failure, an ejection fraction of at least 40%, and pulmonary capillary wedge pressure during exercise of at least 25 mm Hg while exceeding right atrial pressure by at least 5 mm Hg. Patients were randomly assigned (1:1) to receive either a shunt device or sham procedure. Patients and outcome assessors were masked to randomisation. The primary endpoint was a hierarchical composite of cardiovascular death or non-fatal ischemic stroke at 12 months, rate of total heart failure events up to 24 months, and change in Kansas City Cardiomyopathy Questionnaire overall summary score at 12 months. Pre-specified subgroup analyses were conducted for the heart failure event endpoint. Analysis of the primary endpoint, all other efficacy endpoints, and safety endpoints was conducted in the modified intention-to-treat population, defined as all patients randomly allocated to receive treatment, excluding those found to be ineligible after randomisation and therefore not treated. This study is registered with ClinicalTrials.gov, NCT03088033. Findings: Between May 25, 2017, and July 24, 2020, 1072 participants were enrolled, of whom 626 were randomly assigned to either the atrial shunt device (n=314) or sham procedure (n=312). There were no differences between groups in the primary composite endpoint (win ratio 1·0 [95% CI 0·8–1·2]; p=0·85) or in the individual components of the primary endpoint. The prespecified subgroups demonstrating a differential effect of atrial shunt device treatment on heart failure events were pulmonary artery systolic pressure at 20W of exercise (pinteraction=0·002 [>70 mm Hg associated with worse outcomes]), right atrial volume index (pinteraction=0·012 [≥29·7 mL/m2, worse outcomes]), and sex (pinteraction=0·02 [men, worse outcomes]). There were no differences in the composite safety endpoint between the two groups (n=116 [38%] for shunt device vs n=97 [31%] for sham procedure; p=0·11). Interpretation: Placement of an atrial shunt device did not reduce the total rate of heart failure events or improve health status in the overall population of patients with heart failure and ejection fraction of greater than or equal to 40%. Funding: Corvia Medical.