Background: Work-related musculoskeletal disorders (WMSDs) significantly affect bus drivers’ health and warrant adequate attention. Previous studies had reported associations between occupational stress exposure and WMSDs, but the underlying mechanisms remain unclear. This study aimed to evaluate the associations of occupational stress with WMSDs and the mediated effect of sleep quality and nighttime sleep duration. Methods: A total of 1,792 bus drivers with the available information from 5 subsidiaries of Shenzhen Bus Group were included by the convenience sampling method. Logistic regression model was used to estimate the associations of occupational stress, sleep quality and nighttime sleep duration with WMSDs. Mediation analysis was performed to explore the role of sleep quality and nighttime sleep duration in the association between occupational stress and WMSDs. Results: The prevalence rate of single-site, multiple-site, and overall WMSDs among bus drivers were 10.04%, 59.26%, and 69.31%, respectively. We found that occupational stress was significantly associated with an increased risk of both multiple-site WMSDs and overall WMSDs [OR (95% CI) = 1.92 (1.56, 2.36) and 2.03 (1.63, 2.55), respectively]. Compared to those with high sleep quality, bus drivers with poor sleep quality exhibited a higher risk of multiple-site WMSDs and overall WMSDs [OR (95% CI) = 3.73 (2.89, 4.84) and 4.82 (3.53, 6.71), respectively]. Each 1-hour increment in nighttime sleep duration was linked to a 36% declined risk of multiple-site WMSDs and a 37% reduced risk of overall WMSDs [OR (95% CI) = 0.64 (0.58, 0.71) and 0.63 (0.57, 0.70), respectively]. Moreover, mediation analysis showed that sleep quality mediated 48.94% and 48.70%, and nighttime sleep duration mediated 19.63% and 18.64%, of the associations between occupational stress and multiple-site WMSDs and overall WMSDs, respectively. Conclusion: Occupational stress and poor sleep quality significantly elevated the risk of both multiple-site and overall WMSDs, while increased nighttime sleep duration was associated with a reduced risk of multiple-site and overall WMSDs. Sleep quality and nighttime sleep duration emerged as potential mediators in multiple-site and overall WMSDs induced by occupational stress. Highlighting the importance of reducing occupational stress, maintaining good sleep quality and sufficient nighttime sleep duration for WMSDs prevention. © The Author(s) 2025.