IntroductionThere are not enough nurses around the world, and there are even fewer male nurses. It has not been easy for men to become nurses because of stereotypes about the roles of men and women in the workplace, which lead to prejudice and discrimination. This study explored how the self-esteem of male nurses and male nursing students affects their professional identity in an environment where stereotypes and social prejudice exist. This study also examined the differences of relevant variables in different sociodemographic characteristics of the research subjects in a Chinese social context.MethodsBy purposive and snowball sampling, 464 male nurses and male nursing students were surveyed through questionnaires from November 2021 to January 2022. Data analysis was performed using SPSS 25.0 and PROCESS Macro 3.3.ResultsSelf-esteem could indirectly affect professional identity through perceived prejudice and psychological distress. Nonetheless, self-esteem still had a significant direct effect on professional identity. The total mediating effect accounted for 32.816% of the total effect, and the direct effect accounted for 67.184% of the total effect. Also of note was that 81.7% of participants reported experiencing psychological distress.DiscussionTo improve the professional identity of male nurses and male nursing students, nursing educators and administrators should do the following: protect and improve their self-esteem; take steps to reduce social prejudice against them; value their mental health and alleviate their psychological distress.