ImportanceThe months following inpatient psychiatric hospitalization are a period of high risk for suicidal behavior. Sexual and gender minority (SGM) individuals have elevated risk for suicidal behavior, but no prior research has examined whether SGM inpatients have disproportionate risk for suicidal behavior following discharge from psychiatric hospitalization.ObjectivesTo evaluate whether SGM patients have elevated risk for suicidal behavior following discharge from psychiatric hospitalization compared with heterosexual and cisgender patients and to examine whether differences in risk across groups were accounted for by demographic characteristics and clinical factors known to be associated with suicidal behavior.Design, Setting, and ParticipantsThis prospective cohort study was conducted from August 2017 to July 2021 among inpatients aged 18 to 30 years who were voluntarily enrolled during psychiatric hospitalization. The study was conducted at an inpatient psychiatric hospital, with prospective data collected via follow-up visits and electronic health records.Main Outcomes and MeasuresOnset and/or recurrence of suicidal behavior following discharge from psychiatric hospitalization, assessed at follow-up visits and through electronic health records.ResultsA total of 160 patients were included, with 56 sexual minority (SM) and 15 gender minority (GM) patients. The median (IQR) age of the patients was 23.5 (20.4-27.6) years, 77 (48%) reported male sex assigned at birth, and 114 (71%) identified their race as White. During the follow-up period, 33 suicidal behavior events occurred (among 21% of patients). SM (hazard ratio [HR], 2.02; 95% CI, CI, 1.02-4.00; log-rank P = .04) and GM (HR, 4.27; 95% CI, 1.75-10.40; log-rank P < .001) patients had significantly higher risk for suicidal behavior compared with their heterosexual and cisgender counterparts, respectively, in bivariable analyses. Risk between SM and heterosexual patients was not different after controlling for demographic characteristics and clinical factors associated with suicidal behavior. GM patients exhibited elevated risk during the 100 days following discharge even after controlling for demographic and clinical characteristics (HR, 3.80; 95% CI, 1.18-11.19; P = .03).Conclusions and RelevanceWithin this cohort study of psychiatric patients, SGM patients had higher risk for suicidal behavior than non-SGM patients following discharge. While SM patients’ risk was accounted for by clinical characteristics, GM patients’ risk for suicidal behavior was not accounted for by their acute psychiatric state on admission. Future studies with larger subsamples of GM individuals are needed, and inpatient clinicians must attend to the unique needs of SGM individuals to ensure they receive affirming services.