IMPORTANCE Electronic health record (EHR) systems and disease management programs (DMP) are often promoted, but associated health care cost changes are not well understood. OBJECTIVE To evaluate the association between annual health care costs of patients with type 2 diabetes and the use of an electronic health record system with a disease management program (EHR/DMP) in general practice. DESIGN, SETTING, AND PARTICIPANTS This retrospective cohort study examined patients with type 2 diabetes in Denmark between January 1, 2008, and December 31, 2014, who attended practices that either used an EHR/DMP at a high level or never used the disease management system. An EHR/DMP system was rolled out across general practices in Denmark beginning in 2011 and was discontinued in 2014. Data were analyzed between March 2019 and March 2020. MAIN OUTCOMES AND MEASURES The main outcome was total health care costs, and the secondary outcomes were primary care, medication, nonhospital specialist, and hospital (total, outpatient, inpatient, and emergency) costs. Regression models were used to estimate EHR/DMPassociated percentage differences in patients' annual health care treatment costs across health care treatment categories. All models included general practice-level fixed effects and patient-level controls. Two-part models examined robustness of estimated associations for hospital cost categories. RESULTS Of 33 970 patients included in the analysis, 15 953 (8016 [50.2%] male; mean [SD] age, 59.9 [13.3] years) attended 244 general practices that used the system at a high level, and 18 017 (9291 [51.6%] male; mean [SD] age, 60.0 [12.9] years) attended 344 general practices that had never used the system. Use of the EHR/DMP was associated with 3.2% higher (95% CI, 0.9%-5.6%) annual general practice treatment costs and with 6.4% lower (95% CI,-11.6% to-1.2%) annual hospital emergency visit costs. The associations between EHR/DMP use and annual total hospital (percentage difference, −0.8%; 95% CI, −7.5% to 5.7%) and total health care (percentage difference, −0.1%; 95% CI, −2.1% to 1.9%) cost changes were not statistically significant. CONCLUSIONS AND RELEVANCE Among patients with type 2 diabetes, attendance at general practices that used an EHR/DMP was associated with a moderate increase in primary care costs and a reduction in emergency hospital visit costs but no significant change in total health care costs. Large health care cost savings associated with improved use of EHR-based disease management systems should not be expected to be realized in the short term.