Medical workers report high rates of stress, anxiety and depression, which need urgent attention. Providing evidence for intervention measures in the face of a mental health crisis, the present study validates the relation between self-compassion and anxiety and depression mediated by perceived stress amongst medical workers. The goal is also to replicate a similar mediation model though multigroup analysis. Methods: Medical workers were randomly selected to investigate by paper-and-pencil survey among 1,223 medical workers from three hospitals in Shiyan, China. The measures were comprised of four parts: the Chinese version of the Goldberg Anxiety and Depression Scale (GADS), the Self-Compassion Scale-Short Form (SCS-SF), the Perceived Stress Questionnaire (PSQ) and a socio-demographic questionnaire. Applying structural equation modeling (SEM, single-group analysis), we estimated the effects of self-compassion on anxiety/depression through perceived stress. Furthermore, based on multigroup analysis, we used two sets of internal samples (gender groups, medical groups) and an external sample (nursing students) for testing multigroup invariance. Results: The average scores of anxiety, depression, self-compassion and perceived stress in medical workers were 5.93 ± 2.46, 4.91 ± 2.62, 38.87 ± 4.66 and 71.96 ± 15.14, respectively. In some departments engaged in the research, the medical workers showed higher levels of anxiety and depression. The SEM results indicated that the original relationship between self-compassion and anxiety and depression was beta =-0.42 (P < 0.001) and reduced to beta =-0.17 (P < 0.001) while introducing perceived stress as a mediating variable. Perceived stress was positively associated with anxiety and depression (beta = 0.60, P < 0.001), and self-compassion was negatively associated with perceived stress (beta =-0.56, P < 0.001). Multigroup analysis showed acceptable changes in fit indices across gender (male and female), medical (clinician and nonclinician), and population (medical workers and nursing students) groups. Conclusion: Medical workers were experiencing high levels of anxiety and depression and perceived stress. Perceived stress might have a partial mediating effect on self-compassion and anxiety and depression amongst medical workers, which was similar to a previous study in nursing students. The findings supported multigroup invariance across gender, medical and population groups. The study concluded that the mediation model may be generalized across these multiple samples. Psychological intervention could be used to improve levels of selfcompassion of medical workers.