ImportanceThere is an urgent need for evidence to inform preoperative risk assessment for the millions of people who have had SARS-CoV-2 infection and are awaiting elective surgery, which is critical to surgical care planning and informed consent.ObjectiveTo assess the association of prior SARS-CoV-2 infection with death, major adverse cardiovascular events, and rehospitalization after elective major noncardiac surgery.Design, Setting, and ParticipantsThis population-based cohort study included adults who had received a polymerase chain reaction test for SARS-CoV-2 infection within 6 months prior to elective major noncardiac surgery in Ontario, Canada, between April 2020 and October 2021, with 30 days follow-up.ExposuresPositive SARS-CoV-2 polymerase chain reaction test result.Main Outcomes and MeasuresThe main outcome was the composite of death, major adverse cardiovascular events, and all-cause rehospitalization within 30 days after surgery.ResultsOf 71 144 patients who underwent elective major noncardiac surgery (median age, 66 years [IQR, 57-73 years]; 59.8% female), 960 had prior SARS-CoV-2 infection (1.3%) and 70 184 had negative test results (98.7%). Prior infection was not associated with the composite risk of death, major adverse cardiovascular events, and rehospitalization within 30 days of elective major noncardiac surgery (5.3% absolute event rate [n = 3770]; 960 patients with a positive test result; adjusted relative risk [aRR], 0.91; 95% CI, 0.68-1.21). There was also no association between prior infection with SARS-CoV-2 and postoperative outcomes when the time between infection and surgery was less than 4 weeks (aRR, 1.15; 95% CI, 0.64-2.09) or less than 7 weeks (aRR, 0.95; 95% CI, 0.56-1.61) and among those who were previously vaccinated (aRR, 0.81; 95% CI, 0.52-1.26).Conclusions and RelevanceIn this study, prior infection with SARS-CoV-2 was not associated with death, major adverse cardiovascular events, or rehospitalization following elective major noncardiac surgery, although low event rates and wide 95% CIs do not preclude a potentially meaningful increase in overall risk.