Abstract: Objective:This study aims to explore the mediating role of medical students′ professional identity between their perception of tension in doctor-patient relationships and their willingness to pursue a medical career, so as to inform better training of medical professionals and stabilizing the professional team.Methods:From December 2022 to March 2023, a cluster sampling method was used to enroll undergraduate students from the second to fifth year of the five-year clinical medicine program at a medical university in Heilongjiang Province. The study investigated their professional identity, perception of tension in doctor-patient relationships, and willingness to pursue a medical career. Data analysis was conducted using one-way ANOVA, independent sample t-tests, and Pearson correlation analysis. The PROCESS plugin in SPSS 26.0 was utilized to verify the pathways among medical students′ professional identity, perception of tension in doctor-patient relationships, and willingness to practice medicine.Results:The final analysis included 971 medical students. The scores for professional identity were (3.44±0.50), perception of tension in doctor-patient relationships were (2.94±0.62), and willingness to practice medicine were (2.47±0.54). The perception of tension in doctor-patient relationships had a negative predictive effect on the willingness to practice medicine ( β=-0.17, P<0.001), and professional identity played a partial mediating role between the perception of tension in doctor-patient relationships and willingness to practice medicine ( β=-0.03, P<0.001). Conclusions:The study reveals that medical students′ professional identity is at a moderately high level with room for further improvement. There is a negative correlation between medical students′ perception of tension in doctor-patient relationships and their willingness to practice medicine. Professional identity has a mediating effect between the perception of tension in doctor-patient relationships and the willingness to practice medicine.