Mastitis is considered one of the main reasons for unwanted breastfeeding cessation. This study aimed to investigate the preventive effect of the probiotic strain Ligilactobacillus salivarius PS2 on the occurrence of mastitis in lactating women. In this multicountry, multicenter, randomized, double-blind, placebo-controlled trial, 328 women were assigned to the probiotic or the placebo group. The intervention started from the 35th week of pregnancy until week 12 post-partum. The primary outcome was the incidence (hazard) rate of mastitis, defined as the presence of at least two of the following symptoms: breast pain, breast erythema, breast engorgement not relieved by breastfeeding, and temperature > 38 °C. The probability of being free of mastitis during the study was higher in the probiotic than in the placebo group (p = 0.022, Kaplan–Meier log rank test) with 9 mastitis cases (6%) vs. 20 mastitis cases (14%), respectively. The hazard ratio of the incidence of mastitis between both study groups was 0.41 (0.190–0.915; p = 0.029), indicating that women in the probiotic group were 58% less likely to experience mastitis. In conclusion, supplementation of L. salivarius PS2 during late pregnancy and early lactation was safe and effective in preventing mastitis, which is one of the main barriers for continuing breastfeeding.