ObjectivesTo develop and validate a risk prediction model by identifying the preoperative factors associated with an increased risk of pneumonia after spinal surgery. MethodsThis study included patients with spinal disease from two hospitals between January 2021 and June 2023. The patients were divided into the training and validation sets, which were categorized as postoperative pneumonia (POP) or non-POP, respectively. This study identified the independent risk variables for POP using a multivariate logistic regression analysis. A nomogram prediction model was developed and validated using risk factors, receiver operating characteristic (ROC) curves, calibration curves, and decision curve analysis (DCA) to assess predictive performance. ResultsFollowing exclusion, 2223 patients from Changzheng Hospital were enrolled in the training set and 357 patients from the No. 905 Hospital of PLA Navy were enrolled in the validation set. Univariate and multivariate logistic regression analyses revealed that operation time, American Society of Anesthesiologists (ASA) grade, smoking, non-wearing of medical masks, lack of preoperative respiratory training, chronic obstructive pulmonary disease (COPD), underlying diseases, and spinal section were risk factors for POP development in patients with spinal diseases. The area under the ROC curve of the training set was 0.950, whereas that of the validation set was 0.879. The model calibration curves demonstrated good agreement, and the DCA indicated a high expected net benefit value. ConclusionThe POP risk prediction model has high accuracy and efficiency in predicting POP in patients with spinal diseases. POP development is influenced by factors such as operation length, ASA grade, smoking, non-wearing of medical masks, lack of preoperative respiratory training, COPD, underlying diseases, and lumbar surgery.