PurposeThis study analyzes the mediating effect of emotional exhaustion between certain job demands (workload, role conflict, and influence at work) and employees' work attitudes (affective commitment and turnover intention) in public healthcare. Furthermore, it analyzes the moderating effect of possibilities for development and the degree of freedom at work between the above-mentioned job demands and emotional exhaustion.Design/methodology/approachA total of 512 healthcare professionals participated in the study. The data were analyzed using structural equation modeling and a hierarchical multiple regression analysis.FindingsThe results show that emotional exhaustion fully mediates the relationship between job demands (workload and role conflict) and work attitudes (affective commitment and turnover intention). Moreover, the possibilities for development and degree of freedom at work moderate the relationship between role conflict and emotional exhaustion.Practical implicationsStrategies should be designed to prevent employees from becoming emotionally exhausted and lead them to feel more motivated, which results in a more effective public healthcare service.Originality/valueThis study stresses the importance of analyzing the role of emotional exhaustion in the public healthcare context. It demonstrates the mediating role of this variable between several antecedents and consequences, and it analyzes whether other relevant variables can moderate the negative effects of emotional exhaustion.