Shoulder lesions are common in lactating sows and can affect their welfare. We assessed the systemic inflammatory response to shoulder ulcers and monitored the preventive effect of postpartum administration with non-steroidal anti-inflammatory medication (ketoprofen) on their prevalence. In a double-blind placebo-controlled field trial, 144 YxL hybrid sows farrowing in crates with a cast-iron floor received either ketoprofen (3 mg/kg) or placebo as an intramuscular injection on days 0-1 after parturition. During the lactation period (weeks 1-4) all sows were assessed weekly for the presence of shoulder ulcers (0 = no ulcer, 1 = unilateral ulcer, 2 = bilateral ulcers; in all cases at least epithelial damage). From a subset of 37 sows, haptoglobin (Hp), albumin (ALB) and cortisol (COR) were measured from blood samples taken 10 to 12 days after farrowing. Results were analyzed according to a linear regression model for associations between Hp, ALB, COR and shoulder ulcers. A random ordered logistic model was used to assess risk factors (body condition score (BCS), back and shoulder fat, decrease in BCS or fat layer thickness during lactation, parity, number of live born and stillborn piglets, piglets weaned, shoulder ulcer scar) and the effect of ketoprofen treatment. Total prevalence of shoulder ulcers at lactation weeks 1-4 was 26.4%, 33.3%, 38.2% and 38.9%, respectively. Prevalences of unilateral shoulder ulcers at lactation weeks 1-4 were 16.7%, 19.4%, 20.8% and 18.8%, and prevalences of bilateral shoulder ulcers were 9.7%, 13.9%, 17.4%, and 20.1%. There was a decrease in albumin and an increase in Hp levels in sows with bilateral shoulder ulcers compared with sows without shoulder ulcers (P < 0.001) or unilateral shoulder ulcers (P = 0.014 for ALB, P = 0.021 for Hp). Changes in COR levels were not statistically significant but sows with bilateral shoulder ulcers tended to have lower cortisol levels than sows without ulcers (P = 0.061) and sows with unilateral shoulder ulcers (P = 0.089). Ketoprofen failed to protect against shoulder ulcers, but instead the treated sows had an increased number of shoulder lesions at the second and third lactation week (P = 0.023 and P = 0.049). Previous shoulder ulcer was a predisposing factor for shoulder ulcers at all lactation weeks (P < 0.001). Higher body condition score (BCS) and a thicker back and shoulder fat layer protected against shoulder ulcers. The results indicate that bilateral shoulder ulcers trigger a systemic response and should therefore be regarded as a significant finding in clinical evaluation. Postpartum administration of ketoprofen was ineffective in shoulder ulcer prevention.