Background: This study aimed to determine the impact of pulmonary complications on death after surgery both before and during the severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) pandemic. Methods: This was a patient-level, comparative analysis of two, international prospective cohort studies: one before the pandemic (January-October 2019) and the second during the SARS-CoV-2 pandemic (local emergence of COVID-19 up to 19 April 2020). Both included patients undergoing elective resection of an intra-abdominal cancer with curative intent across five surgical oncology disciplines. Patient selection and rates of 30-day postoperative pulmonary complications were compared. The primary outcome was 30-day postoperative mortality. Mediation analysis using a natural-effects model was used to estimate the proportion of deaths during the pandemic attributable to SARS-CoV-2 infection. Results: This study included 7402 patients from 50 countries; 3031 (40.9 per cent) underwent surgery before and 4371 (59.1 per cent) during the pandemic. Overall, 4.3 per cent (187 of 4371) developed postoperative SARS-CoV-2 in the pandemic cohort. The pulmonary complication rate was similar (7.1 per cent (216 of 3031) versus 6.3 per cent (274 of 4371); P = 0.158) but the mortality rate was significantly higher (0.7 per cent (20 of 3031) versus 2.0 per cent (87 of 4371); P < 0.001) among patients who had surgery during the pandemic. The adjusted odds of death were higher during than before the pandemic (odds ratio (OR) 2.72, 95 per cent c.i. 1.58 to 4.67; P < 0.001). In mediation analysis, 54.8 per cent of excess postoperative deaths during the pandemic were estimated to be attributable to SARS-CoV-2 (OR 1.73, 1.40 to 2.13; P < 0.001). Conclusion: Although providers may have selected patients with a lower risk profile for surgery during the pandemic, this did not mitigate the likelihood of death through SARS-CoV-2 infection. Care providers must act urgently to protect surgical patients from SARS-CoV-2 infection.