Insulin secretion from pancreatic β-cells is impaired in all forms of diabetes. The resultant hyperglycaemia has deleterious effects on many tissues, including β-cells. Here we show that chronic hyperglycaemia impairs glucose metabolism and alters expression of metabolic genes in pancreatic islets. In a mouse model of human neonatal diabetes, hyperglycaemia results in marked glycogen accumulation, and increased apoptosis in β-cells. Sulphonylurea therapy rapidly normalizes blood glucose levels, dissipates glycogen stores, increases autophagy and restores β-cell metabolism. Insulin therapy has the same effect but with slower kinetics. Similar changes are observed in mice expressing an activating glucokinase mutation, in in vitro models of hyperglycaemia, and in islets from type-2 diabetic patients. Altered β-cell metabolism may underlie both the progressive impairment of insulin secretion and reduced β-cell mass in diabetes. r The Author(s) 2016.