Importance: Posttraumatic stress disorder (PTSD) is associated with an increased risk of type 2 diabetes mellitus (T2DM). Existing literature has adjusted for obesity in combination with other confounders, which does not allow estimating the contribution of obesity alone on the association of PTSD with incident T2DM. Objective: The current study was designed to determine if obesity accounted for the association between PTSD and incident T2DM. Design, Setting, and Participants: This cohort study used data from Veterans Health Administration medical records collected from patients with PTSD and without PTSD from 2008 to 2015. Patients were eligible for study inclusion if they were free of prevalent PTSD and T2DM for 12 months prior to index date. To estimate whether the association of PTSD and incident T2DM remained independent of obesity, Cox proportional hazard models were computed before and after adding obesity to the model and then further expanded by adding psychiatric disorders, psychotropic medications, physical conditions, smoking status, and demographics. Additional Cox models were computed to compare the risk of incident T2DM in patients with PTSD with and without obesity. Data analysis was completed from February 2018 to May 2018. Exposures: Two International Classification of Diseases, Ninth Revision (ICD-9) codes for PTSD in the same 12 months and obesity, defined by a body mass index of 30 or more or an ICD-9 code for obesity. Main Outcomes and Measures: Incident T2DM, as defined by ICD-9 codes. Results: Among 2204 patients without PTSD, the mean (SD) age was 47.7 (14.3) years; 1860 (84.4%) were men, 1426 (64.7%) were white, and 956 (43.4%) were married. Among 3450 patients with PTSD, the mean (SD) age was 42.8 (14.2) years; 2983 (86.5%) were men, 2238 (64.9%) were white, and 1525 (44.2%) were married. The age-adjusted association between PTSD and incident T2DM was significant (hazard ratio [HR], 1.33 [95% CI, 1.08-1.64]; P =.01), and after adding obesity to the model, this association was reduced and no longer significant (HR, 1.16 [95% CI, 0.94-1.43]; P =.18). Results of the full model, which included additional covariate adjustment, revealed no association between PTSD and incident T2DM (HR, 0.84 [95% CI, 0.64-1.10]; P =.19). Among patients with PTSD with obesity, the age-adjusted incidence of T2DM was 21.0 per 1000 person-years vs 5.8 per 1000 person-years in patients without obesity. In patients without PTSD, it was 21.2 per 1000 person-years for patients with obesity vs 6.4 per 1000 person-years in those without obesity. Conclusions and Relevance: In this study of patients who use the Veterans Health Administration for health care, obesity moderated the association between PTSD and incident T2DM. The incidence of T2DM in patients with PTSD who are not obese is similar to the national incidence rate in the United States. These results suggest PTSD is not likely to have a causal association with incident T2DM. Future research is needed to determine if PTSD remission can lead to weight loss and reduced T2DM incidence.