Background and purpose — Indication for lumbar disc herniation (LDH) surgery is usually to relieve sciatica. We evaluated whether back pain also decreases after LDH surgery. Patients and methods — In the Swedish register for spinal surgery (SweSpine) we identified 14,097 patients aged 20–64 years, with pre- and postoperative data, who in 2000–2016 had LDH surgery. We calculated 1-year improvement on numeric rating scale (rating 0–10) in back pain (Nback) and leg pain (Nleg) and by negative binomial regression relative risk (RR) for gaining improvement exceeding minimum clinically important difference (MCID). Results — Nleg was preoperatively (mean [SD]) 6.7 (2.5) and Nback was 4.7 (2.9) (p < 0.001). Surgery reduced Nleg by mean 4.5 (95% CI 4.5–4.6) and Nback by 2.2 (CI 2.1–2.2). Mean reduction in Nleg) was 67% and in Nback 47% (p < 0.001). Among patients with preoperative pain ≥ MCID (that is, patients with significant baseline pain and with a theoretical possibility to improve above MCID), the proportion who reached improvement ≥ MCID was 79% in Nleg and 60% in Nback. RR for gaining improvement ≥ MCID in smokers compared with non-smokers was for Nleg 0.9 (CI 0.8–0.9) and Nback 0.9 (CI 0.8–0.9), and in patients with preoperative duration of back pain 0–3 months compared with > 24 months for Nleg 1.3 (CI 1.2–1.5) and for Nback 1.4 (CI 1.2–1.5). Interpretation — LDH surgery improves leg pain more than back pain; nevertheless, 60% of the patients with significant back pain improved ≥ MCID. Smoking and long duration of pain is associated with inferior recovery in both Nleg and Nback.