Dietary treatment is important in management of type 2 diabetes or prediabetes, but uncertainty exists about the optimal diet. We randomized adults (n = 34) with glycated hemoglobin (HbA1c) > 6.0% and elevated body weight (BMI > 25) to a very low-carbohydrate ketogenic (LCK) diet (n = 16) or a moderate-carbohydrate, calorie-restricted, low-fat (MCCR) diet (n = 18). All participants were encouraged to be physically active, get sufficient sleep, and practice behavioral adherence strategies based on positive affect and mindful eating. At 12 months, participants in the LCK group had greater reductions in HbA1c levels (estimated marginal mean (EMM) at baseline = 6.6%, at 12 mos = 6.1%) than participants in MCCR group (EMM at baseline = 6.9%, at 12 mos = 6.7%), p = .007. Participants in the LCK group lost more weight (EMM at baseline = 99.9 kg, at 12 mos = 92.0 kg) than participants in the MCCR group (EMM at baseline = 97.5 kg, at 12 mos = 95.8 kg), p < .001. The LCK participants experienced larger reductions in diabetes-related medication use; of participants who took sulfonylureas or dipeptidyl peptidase-4 inhibitors at baseline, 6/10 in the LCK group discontinued these medications compared with 0/6 in the MCCR group (p = .005). In a 12-month trial, adults with elevated HbA1c and body weight assigned to an LCK diet had greater reductions in HbA1c, lost more weight, and reduced more medications than those instructed to follow an MCCR diet.