During early fasting, increases in skeletal muscle proteolysis liberate free amino acids for hepatic gluconeogenesis in response to pancreatic glucagon. Hepatic glucose output diminishes during the late protein-sparing phase of fasting, when ketone body production by the liver supplies compensatory fuel for glucose-dependent tissues. Glucagon stimulates the gluconeogenic program by triggering the dephosphorylation and nuclear translocation of the CREB regulated transcription coactivator 2 (CRTC2; also known as TORC2), while parallel decreases in insulin signalling augment gluconeogenic gene expression through the dephosphorylation and nuclear shuttling of forkhead box O1 (FOXO1). Here we show that a fasting-inducible switch, consisting of the histone acetyltransferase p300 and the nutrient-sensing deacetylase sirtuin 1 (SIRT1), maintains energy balance in mice through the sequential induction of CRTC2 and FOXO1. After glucagon induction, CRTC2 stimulated gluconeogenic gene expression by an association with p300, which we show here is also activated by dephosphorylation at Ser 89 during fasting. In turn, p300 increased hepatic CRTC2 activity by acetylating it at Lys 628, a site that also targets CRTC2 for degradation after its ubiquitination by the E3 ligase constitutive photomorphogenic protein (COP1). Glucagon effects were attenuated during late fasting, when CRTC2 was downregulated owing to SIRT1-mediated deacetylation and when FOXO1 supported expression of the gluconeogenic program. Disrupting SIRT1 activity, by liver-specific knockout of the Sirt1 gene or by administration of a SIRT1 antagonist, increased CRTC2 activity and glucose output, whereas exposure to SIRT1 agonists reduced them. In view of the reciprocal activation of FOXO1 and its coactivator peroxisome proliferator-activated receptor-gamma coactivator-1alpha (PGC-1alpha, encoded by Ppargc1a) by SIRT1 activators, our results illustrate how the exchange of two gluconeogenic regulators during fasting maintains energy balance.