Glucose homeostasis is regulated systemically by hormones such as insulin and glucagon, and at the cellular level by energy status. Glucagon enhances glucose output from the liver during fasting by stimulating the transcription of gluconeogenic genes via the cyclic AMP-inducible factor CREB (CRE binding protein). When cellular ATP levels are low, however, the energy-sensing kinase AMPK inhibits hepatic gluconeogenesis through an unknown mechanism. Here we show that hormonal and energy-sensing pathways converge on the coactivator TORC2 (transducer of regulated CREB activity 2) to modulate glucose output. Sequestered in the cytoplasm under feeding conditions, TORC2 is dephosphorylated and transported to the nucleus where it enhances CREB-dependent transcription in response to fasting stimuli. Conversely, signals that activate AMPK attenuate the gluconeogenic programme by promoting TORC2 phosphorylation and blocking its nuclear accumulation. Individuals with type 2 diabetes often exhibit fasting hyperglycaemia due to elevated gluconeogenesis; compounds that enhance TORC2 phosphorylation may offer therapeutic benefits in this setting.