ImportanceMistreatment is a common experience among medical students, with various negative consequences of such perceived mistreatment reported. However, few large-scale studies have investigated the association between perceived mistreatment and the formation of medical students’ professional identities.ObjectiveTo investigate medical students’ perceived mistreatment during medical school and its association with professional identity.Design, Setting, and ParticipantsThis repeated cross-sectional study included medical students graduating between 2019 and 2022 at 135 medical schools in China. Analyses were performed from July 25, 2023, to May 15, 2024.ExposureThe China Medical Student Survey includes 5 items designed to measure students’ perceived experiences of mistreatment.Main Outcomes and MeasuresProfessional identity was measured using a validated 7-item scale adapted from the Macleod Clark Professional Identity Scale. Multivariate linear regression was used to determine the association between perceived mistreatment and medical students’ professional identity.ResultsA total of 94 153 students (53 819 female [57.2%]; 83 548 Han ethnicity [88.7%]) were analyzed, representing 67.2% of the medical graduates enrolled in all responding medical schools. Most medical students reported having experienced at least 1 mistreatment incident (79 554 students [84.5%]). Medical students reported being required to perform personal service (57 455 students [61.0%]), experiencing mistreatment by patients (67 439 students [71.6%]), being publicly humiliated (24 348 students [25.9%]), being unjustly treated (35 926 students [38.2%]), and experiencing deliberate harassment (46 082 students [48.9%]). A negative association and saturation effect (where effect size plateaus after moderate exposure of mistreatment) were found between the degree of mistreatment and medical students’ professional identity scores. Compared with students who had not reported mistreatment, students who reported single (β, −0.30; 95% CI, −0.33 to −0.28; P < .001), moderate (β, −0.66; 95% CI, −0.69 to −0.63; P < .001), and high (β, −0.62; 95% CI, −0.65 to −0.58; P < .001) frequency of mistreatment were more likely to have lower professional identity scores; this association persisted but was attenuated after adjusting for students’ sociodemographic characteristics and was consistent across all the types of mistreatment.Conclusions and RelevanceIn this national, repeated cross-sectional study, a high prevalence of mistreatment among medical students in China and a negative association between perceived mistreatment and medical students’ professional identity was found. Further research is needed to ensure that medical schools offer supportive and respectful learning environments.