Background Difficulties in improving psychological safety in medical education can be attributed to the hierarchy of medical professionals. Near-peer learning (NPL) can increase learning between students and residents and improve psychological safety. Rural community-based medical education (CBME) can use an NPL framework to improve psychological safety and compensate for the lack of resources, leading to sustainability. This qualitative study aimed to clarify the effects of NPL on the psychological safety and learning of medical trainees in rural CBME. It used a grounded theory approach.Methods Thirty-eight medical students, twelve second-year residents, and eight family medicine residents participated in this study. Purposive sampling was used to address the research purposes of ethnographic and semi-structured interviews.Results Three themes were identified: facilitating learning, change in perception, and change in learning. Rural NPL-based CBME drove learners’ engagement in clinical practice through constant participation and reflection. Respecting and supporting learners’ motivation and participation and effectively accepting them increased their sense of ownership and psychological safety. Furthermore, it supported participants in becoming self-regulated learners.Conclusions Rural CBMEs lack healthcare and educational resources, but implementing NPL could make rural medical education sustainable, increasing the motivation of healthcare students and the number of medical staff working in rural contexts.