In their interactions with patients and health care professionals during work-based learning, medical students are known to experience emotionally challenging situations that can evoke negative feelings. Students have to manage these emotions. Students learn and develop their professional identity formation through interactions with patients and members of the healthcare teams. Earlier studies have highlighted the issues involved with processing emotionally challenging situations, although studies concerning learning and professional identity formation in response to these experiences are rare. In this study, we explored medical students’ experiences of emotionally challenging situations in work-based learning, and the impact these experiences had on forming medical students’ professional identities. We conducted an analysis of narrative data (n= 85), using a constructivist grounded theory approach. The narratives were made up of medical students’ reflective essays at the end of their education (tenth term). The analysis showed that students’ main concern when facing emotionally challenging situations during their work-based education was the struggle to achieve and maintain a professional approach. They reported different strategies for managing their feelings and how these strategies led to diverse consequences. In the process, students also described arriving at insights into their own personal needs and shortcomings. We consider this development of self-awareness and resulting self-knowledge to be an important part of the continuously ongoing socialization process of forming a professional identity. Thus, experiencing emotionally challenging situations can be considered a unique and invaluable opportunity, as well as a catalyst for students’ development. We believe that highlighting the impact of emotions in medical education can constitute an important contribution to knowledge about the process of professional identity formation. This knowledge can enable faculty to provide students with more effective and sufficient support, facilitating their journey in becoming physicians.