Background: The aim of the study was to evaluate an online virtual educational experience on resident physician knowledge and ability to manage patients with diabetes mellitus (DM). Methods: 341 consented residents in 19 residency programs were randomized to receive (n=177) or not receive (n=164) the 18 virtual learning cases. Each unique case required about 15 minutes to complete using a web-based interactive electronic health record-like interface that challenged providers to take clinical actions to bring patients to all care goals within 6 months of simulated time. Physiologic modeling simulated realistic outcomes of provider actions, and providers received feedback designed to critique and guide them between longitudinal encounters. After the intervention period, all residents were assigned a 10-question knowledge test and 4 virtual performance assessment cases. Generalized linear mixed models were used to test for study arm differences in knowledge scores and the proportion of residents bringing each virtual case to composite goals for glucose, blood pressure, and lipids. Results: 232 residents (97 intervention, 135 control) completed at least one assessment case. Residents were 52% female; 52% white; mean age 31; 44% family medicine, 53% internal medicine; and in post-graduate years (PGY) 1 (34%), 2 (35%), 3 and 4 (28.5%). The proportion of residents bringing patients to composite goal using case-specific pre-determined appropriate and safe treatment criteria was significantly higher in the intervention group than control: case 1 - 21.2%, vs. 1.8%, p=.002; case 2 – 15.7% vs. 4.7%, p=.02; case 3 – 48.0% vs. 10.4%, p< .001; case 4 - 42.1% vs. 18.7%, p=.002. Mean knowledge scores (intervention vs. control) for all residents was 5.3 vs. 4.1 (p=.0005), and by PGY were PGY 1 - 5.2 vs. 3.8 (p=.0008), PGY 2 - 5.2 vs. 4.1 (p=.0009), PGY 3 and 4 – 5.2 vs. 4.5 (p=.14). Conclusions: The simulation-based training was successful at improving resident knowledge scores and resident ability to achieve care goals using virtual patients. Differences on assessment case performance by intervention/control group were fairly consistent across PGY 1-4. However, study group effects on the knowledge test appeared stronger for first-year residents compared to those in later years.