Introduction: There is evidence that lesbian, gay, and bisexual (LGB) adults have poorer cardiovascular health than their heterosexual peers, but studies of the association between sexual orientation (SO) and diabetes mellitus (DM) have been few. Prior studies have largely been cross-sectional, rely on self-reported data, and have small sample size; findings have been mixed. To further investigate this association, large nationwide cohorts with objective data capture are needed. Methods and Results: We used data from the Veterans Healthcare Administration Lesbian, Gay, Bisexual, Transgender EHR cohort which includes veterans with ≥2 encounters October 1, 2009-September 30, 2019. The first clinic visit in this window was the index date with the baseline date one year later; the subsequent year served as a baseline period for observation of prevalent disease and comorbidities. We did not include transgender veterans in this analysis in order to focus on SO rather than on the intersection of SO with gender identity. The SO of 1,108,990 veterans was identified using a natural language processing tool; 185,788 veterans were classified as LGB. Prevalent DM (ICD-9/10 codes or HbA1c≥6.5%) was present among 193,330 veterans (32,986 LGB). We first examined sample characteristics by sex and SO. Mean age (years) and BMI (kg/m 2 ) were similar across SO in women (age: 41, BMI: 29) and men (age: 53, BMI: 30). Although the distribution of race was similar across groups, LGB men and women were more likely to be of Hispanic ethnicity (11%, both sexes) than non-LGB men and women (6% and 8%, respectively). Current smoking was more prevalent among LGB (44% men, 39% women) than among non-LGB veterans (40% men, 30% women). We used logistic regression to assess the association between SO and DM. Adjusting for age, sex, race, Hispanic ethnicity, BMI, smoking status, health insurance, marital status, and enrollment priority group (based on military service history, disability and income), LGB veterans had 1.12 [1.10, 1.13] times the odds of DM versus non-LGB veterans. Among women, those classified as bisexual (0.87 [0.74, 1.01]) or lesbian (1.03 [0.97, 1.10]) did not have significantly different odds of DM than non-LGB women. Among men, bisexual men had lower odds of DM (0.86 [0.80, 0.93]) while gay men had higher odds (1.04 [1.01, 1.06]) than non-LGB men. In both men and women, sexual minority individuals whose SO could not be classified had greater odds of DM than their non-LGB peers (women: 1.15 [1.08, 1.23]; men: 1.25 [1.22, 1.28]). Conclusion: This is one of the first studies to examine DM in a veteran population stratified by SO. Our sex-specific findings highlight the importance of examining each SO group separately, in addition to jointly, as to further elucidate the association between SO, cardiovascular risk factors, and general cardiovascular health. Future work will examine the intersection of SO with gender identity.