Fructose-1,6-bisphosphate (FBP) aldolase/phosphatase is a bifunctional, thermostable enzyme that catalyses two subsequent steps in gluconeogenesis in most archaea and in deeply branching bacterial lineages. It mediates the aldol condensation of heat-labile dihydroxyacetone phosphate (DHAP) and glyceraldehyde-3-phosphate (GAP) to FBP, as well as the subsequent, irreversible hydrolysis of the product to yield the stable fructose-6-phosphate (F6P) and inorganic phosphate; no reaction intermediates are released. Here we present a series of structural snapshots of the reaction that reveal a substantial remodelling of the active site through the movement of loop regions that create different catalytic functionalities at the same location. We have solved the three-dimensional structures of FBP aldolase/phosphatase from thermophilic Thermoproteus neutrophilus in a ligand-free state as well as in complex with the substrates DHAP and FBP and the product F6P to resolutions up to 1.3 Å. In conjunction with mutagenesis data, this pinpoints the residues required for the two reaction steps and shows that the sequential binding of additional Mg(2+) cations reversibly facilitates the reaction. FBP aldolase/phosphatase is an ancestral gluconeogenic enzyme optimized for high ambient temperatures, and our work resolves how consecutive structural rearrangements reorganize the catalytic centre of the protein to carry out two canonical reactions in a very non-canonical type of bifunctionality.