BackgroundThe prevalence of postoperative pain is notably high among the elderly population, which poses significant challenges for their postoperative recovery. In this study, we aimed to identify preoperative predictors for acute and chronic postoperative pain in patients undergoing lumbar spinal surgery through a longitudinal investigation.MethodsWe recruited 75 patients (mean age 68.29 ± 5.60 years) and collected their resting‐state electroencephalography (EEG) data two hours before the surgery. The aperiodic and periodic signal components were extracted from the resting‐state EEG using the Fitting Oscillations and One‐Over‐F algorithm. We also collected the preoperative pain ratings, demographic information and the Hospital Anxiety and Depression Scale from all patients. The postoperative pain ratings were collected ten times from Day 1 to Week 12 after surgery.ResultsWe observed a high incidence of postoperative acute and chronic pain among older patients. Preoperative pain and peak alpha frequency in resting‐state EEG were the primary predictors of acute postoperative pain. Although age is a significant predictor of chronic postoperative pain, its predictive performance is poor.ConclusionsOverall, our study provides valuable insights into the complex pattern of preoperative EEG features, preoperative pain and age in predicting postoperative pain at different stages. Our findings highlight the significance of exploring preoperative features to identify patients who are at a higher risk of developing severe postoperative pain, which can aid in the development of more personalized and effective pain management strategies.SignificanceThe heightened occurrence of postoperative pain among the elderly presents formidable obstacles to their recuperation. This study delves into identifying preoperative factors influencing acute and chronic postoperative pain. Our findings indicate that preoperative pain and peak alpha frequency are crucial predictors of acute postoperative pain. However, the predictive performance for chronic postoperative pain is limited, although age was a significant predictor of chronic postoperative pain. These insights contribute to the identification of patients at elevated risk for severe acute and chronic postoperative pain, offering valuable guidance for pre‐surgical risk assessment.