Objective To investigate the occurrence of chronic postsurgical pain (CPSP) among patients with preoperative COVID-19, and further analyze the risk factors for CPSP. Methods This study was a ambispective cohort study, with subjects from a completed cohort study with follow-up. We included the clinical data of the patients with preoperative COVID-19 who underwent surgery at Peking Union Medical College Hospital from December 1, 2022 to February 28, 2023. Follow-up was conducted up to 6 months postoperatively, with the primary outcome being CPSP. Multivariate Logistic regression analysis was used to analyze the correlation between COVID-19-related exposure indicators and CPSP. Results A total of 4117 surgical patients were included, all of whom had preoperative COVID-19. Among them, 4002 cases had mild symptoms during the acute phase, 62 cases had severe symptoms, and 53 cases were critically ill. At 6th month postoperatively, 1298 cases (31.53%) had long COVID-19 syndrome, and the incidence of CPSP was 5.59% (95% CI: 4.88%-6.28%). After adjusting for confounding factors including age, gender, comorbidities, anesthesia method, and type of surgery, multivariate Logistic regression analysis revealed that critically ill COVID-19 during the acute phase (aOR=3.35, 95% CI: 1.48-7.62, P < 0.001) and presence of long COVID-19 syndrome postoperatively (aOR=2.50, 95% CI: 1.90-3.29, P < 0.001) were associated with CPSP. Conclusions It is clear for the first time that critically ill COVID-19 during the acute phase and the presence of long COVID-19 syndrome postoperatively are the risk factors for CPSP among patients with preoperative COVID-19.