Background: Since the outbreak of coronavirus disease (COVID-19), accumulating evidence has indicated alterations in cognitive function after infection with SARS-CoV-2 (the causative agent of COVID-19). However, the specific effect of a prior COVID-19 history on postoperative neurocognitive outcomes remains elusive. In this study, we aimed to establish the correlation between COVID-19 history and the onset of postoperative delirium (POD) and delayed neurocognitive recovery (DNR) among older adults. Methods: This study enrolled a total of 578 older adults (aged ≥ 60 years) who were scheduled for major abdominal surgeries. The primary outcome was POD incidence. Secondary outcomes included the frequency, duration, and subtype of POD; DNR occurrence; acute postsurgical pain (APSP); and other prognosis-related indicators. Results: Patients with prior COVID-19 exhibited an increased risk of developing POD (odds ratio [OR]: 3.09; 95% confidence interval [CI]: 1.19–7.98; P = 0.02). The risk of DNR 30 days after surgery was not significantly associated with COVID-19 (OR: 0.54; 95% CI: 0.23–1.26; P = 0.15). Both APSP (OR: 1.51; 95% CI: 1.06–2.16; P = 0.02) and COVID-19 vaccination (OR: 0.47; 95% CI: 0.26–0.86; P = 0.01) were identified as independent influencing factors for POD. E-value analysis supported the robustness of the primary finding. Mediation analysis further revealed that APSP had a significant indirect effect (0.12; 95% CI: 0.02–0.27) in the relationship between COVID-19 and POD. Conclusion: Prior SARS-CoV-2 infection was independently associated with an increased risk of POD, which was potentially mediated by APSP. In contrast, no significant association was observed between prior COVID-19 and DNR incidence. In addition, full COVID-19 vaccination significantly reduced the risk of POD, suggesting that perioperative COVID-19 vaccine promotion is a potential public health strategy for improving the prognosis of the elderly.