Summary: Some antihyperglycemic medications have been found to affect bone metabolism. We assessed the long-term effects of metformin compared with placebo on bone mineral density (BMD) and trabecular bone score (TBS) in patients with type 2 diabetes. Metformin had no significant effect on BMD in the spine and hip or TBS compared with a placebo. Introduction: Patients with type 2 diabetes mellitus (T2DM) have an increased risk of fractures despite a high bone mass. Some antihyperglycemic medications have been found to affect bone metabolism. We assessed the long-term effects of metformin compared with placebo on bone mineral density (BMD) and trabecular bone score (TBS). Methods: This was a sub-study of a multicenter, randomized, 18-month placebo-controlled, double-blinded trial with metformin vs. placebo in combination with different insulin regimens (the Copenhagen Insulin and Metformin Therapy trial) in patients with T2DM. BMD in the spine and hip and TBS in the spine were assessed by dual-energy X-ray absorptiometry at baseline and after 18 months follow-up. Results: Four hundred seven patients were included in this sub-study. There were no between-group differences in BMD or TBS. From baseline to 18 months, TBS decreased significantly in both groups (metformin group, − 0.041 [− 0.055, − 0.027]; placebo group − 0.046 [− 0.058, − 0.034]; both p < 0.001). BMD in the spine and total hip did not change significantly from baseline to 18 months. After adjustments for gender, age, vitamin D, smoking, BMI, duration of T2DM, HbA1c, and insulin dose, the TBS between-group differences increased but remained non-significant. HbA1c was negatively associated with TBS (p = 0.009) as was longer duration of diabetes, with the femoral neck BMD (p = 0.003). Body mass index had a positive effect on the hip and femoral neck BMD (p < 0.001, p = 0.045, respectively). Conclusions: Eighteen months of treatment with metformin had no significant effect on BMD in the spine and hip or TBS in patients with T2DM compared with a placebo. TBS decreased significantly in both groups. Trial registration: ClinicalTrials.gov (NCT00657943).