Background: Medical residents usually suffer from work overload and experience both personal and professional distress, which affects their level of the empathy to patients. Psychological capital (PsyCap) is a psychological resource that is negatively associated with indicators of distress. Objective: This study explored the potential mediating effect of PsyCap on the relationship between distress and empathy, which may help healthcare professionals in their defense of empathy erosion due to distress. Design: A total of 620 first-year residents were recruited for this cross-sectional survey. Empathy and PsyCap of residents were assessed by the Chinese version of the Jefferson Scale of Physician Empathy and the Psychological Capital Questionnaire, respectively. In this study, both personal and professional aspects contributing to resident distress were investigated by the Satisfaction with Life Scale and an occupational distress scale. T-tests and oneway ANOVA were used to test differences in empathy of residents. Pearson's correlation was used to examine correlations between distress, PsyCap, and empathy. Structured equation modeling was used to conduct the pathway analysis to test the mediating effect of PsyCap on the association between distress and empathy. Results: 537 residents (86.6%) completed the survey. Distress, empathy, and PsyCap were significantly correlated (P < .01) and in the expected directions. The first step analysis showed that as distress increased, the empathy of residents significantly decreased (P < .01), with the direct effect coefficient being 0.265. When PsyCap was included, the direct effect coefficient decreased to 0.033. This indirect effect was significant (P < .01). The variance accounted for was 81.14%, which indicated a partial mediating effect of PsyCap. Conclusions: PsyCap may serve a significant protective role against the impact of distress on the level of empathy of medical residents. In addition to reducing distress, PsyCap development could be considered in empathy decline prevention and empathy cultivating strategies.