IMPORTANCE Previous studies have shown that medical student mistreatment is common. However, few data exist to date describing how the prevalence of medical student mistreatment varies by student sex, race/ethnicity, and sexual orientation.OBJECTIVE To examine the association between mistreatment and medical student sex, race/ethnicity, and sexual orientation. DESIGN, SETTING, AND PARTICIPANTS This cohort study analyzed data from the 2016 and 2017 Association of American Medical Colleges Graduation Questionnaire. The questionnaire annually surveys graduating students at all 140 accredited allopathic US medical schools. Participants were graduates from allopathic US medical schools in 2016 and 2017. Data were analyzed between April 1 and December 31, 2019. MAIN OUTCOMES AND MEASURES Prevalence of self-reported medical student mistreatment by sex, race/ethnicity, and sexual orientation. RESULTS A total of 27 504 unique student surveys were analyzed, representing 72.1% of graduating US medical students in 2016 and 2017. The sample included the following: 13 351 female respondents (48.5%), 16 521 white (60.1%), 5641 Asian (20.5%), 2433 underrepresented minority (URM) (8.8%), and 2376 multiracial respondents (8.6%); and 25 763 heterosexual (93.7%) and 1463 lesbian, gay, or bisexual (LGB) respondents (5.3%). At least 1 episode of mistreatment was reported by a greater proportion of female students compared with male students (40.9% vs 25.2%, P < .001); Asian, URM, and multiracial students compared with white students (31.9%, 38.0%, 32.9%, and 24.0%, respectively; P < .001); and LGB students compared with heterosexual students (43.5% vs 23.6%, P < .001). A higher percentage of female students compared with male students reported discrimination based on gender (28.2% vs 9.4%, P < .001); a greater proportion of Asian, URM, and multiracial students compared with white students reported discrimination based on race/ethnicity (15.7%, 23.3%, 11.8%, and 3.8%, respectively; P < .001), and LGB students reported a higher prevalence of discrimination based on sexual orientation than heterosexual students (23.1% vs 1.0%, P < .001). Moreover, higher proportions of female (17.8% vs 7.0%), URM, Asian, and multiracial (4.9% white, 10.7% Asian, 16.3% URM, and 11.3% multiracial), and LGB (16.4% vs 3.6%) students reported 2 or more types of mistreatment compared with their male, white, and heterosexual counterparts (P < .001).CONCLUSIONS AND RELEVANCE Female, URM, Asian, multiracial, and LGB students seem to bear a disproportionate burden of the mistreatment reported in medical schools. It appears that addressing the disparate mistreatment reported will be an important step to promote diversity, equity, and inclusion in medical education.