Background: Cardiopulmonary exercise testing (CPET) provides an objective assessment of functional capacity. The aim of this study was to assess whether preoperative CPET identifies patients at risk of early death following elective open and endovascular abdominal aortic aneurysm (AAA) repair. Methods: Prospective data were collected from a pilot study between September 2005 and February 2007, and from all patients who underwent CPET before elective AAA repair at two vascular centres between February 2007 and November 2011. Symptom-limited, maximal CPET was performed on each patient. Univariable and multivariable analyses were used to identify risk factors for 30- and 90-day mortality. Results: Some 415 patients underwent CPET before elective AAA repair. Anaerobic threshold (AT), peak oxygen consumption (peak V̇O2) and ventilatory equivalents for carbon dioxide were associated with 30- and 90-day mortality on univariable analysis. On multivariable analysis, open repair (odds ratio (OR) 4·92, 95 per cent confidence interval 1·55 to 17·00; P = 0·008), AT below 10·2 ml per kg per min (OR 6·35, 1·84 to 29·80; P = 0·007), anaemia (OR 3·27, 1·04 to 10·50; P = 0·041) and inducible cardiac ischaemia (OR 6·16, 1·48 to 23·07; P = 0·008) were associated with 30-day mortality. Anaemia, inducible cardiac ischaemia and peak V̇O2 less than 15 ml per kg per min (OR 8·59, 2·33 to 55·75; P = 0·005) were associated with 90-day mortality on multivariable analysis. Patients with two or more subthreshold CPET values were at increased risk of both 30- and 90-day mortality. Conclusion: An AT below 10·2 ml per kg per min, peak V̇O2 less than 15 ml per kg per min and at least two subthreshold CPET values identify patients at increased risk of early death following AAA repair.