A retrospective cohort study of 120 patients compared ultrasound-guided erector spinae plane block (ESPB) with 0.375% ropivacaine and conventional analgesia after thoracoscopic lobectomy. The ESPB group had significantly lower visual analog scale (VAS) pain scores at 1, 6, 12, and 24 hours (eg, 3.2 vs. 5.6; p < 0.001). Total 24-hour morphine consumption decreased by 42.6% (20.5 mg vs. 35.7 mg; p < 0.001). Pulmonary function was better preserved, with higher FEV1 and FVC values on postoperative days 1 and 3 (all p < 0.01). Pain scores were negatively correlated with pulmonary parameters (r = –0.45 to –0.50; p < 0.001). Hospital stay was shorter (5.2 vs. 6.5 days; p = 0.001) and patient satisfaction was higher (4.5 vs. 3.8; p < 0.001). Complications were comparable between groups. ESPB improves postoperative analgesia and recovery of lung function without additional risks.