Liquid water’s isothermal compressibility1 and isobaric heat capacity2, and the magnitude of its thermal expansion coefficient3, increase sharply on cooling below the equilibrium freezing point. Many experimental4,5,6,7,8, theoretical9,10,11 and computational12,13 studies have sought to understand the molecular origin and implications of this anomalous behaviour. Of the different theoretical scenarios9,14,15 put forward, one posits the existence of a first-order phase transition that involves two forms of liquid water and terminates at a critical point located at deeply supercooled conditions9,12. Some experimental evidence is consistent with this hypothesis4,16, but no definitive proof of a liquid–liquid transition in water has been obtained to date: rapid ice crystallization has so far prevented decisive measurements on deeply supercooled water, although this challenge has been overcome recently16. Computer simulations are therefore crucial for exploring water’s structure and behaviour in this regime, and have shown13,17,18,19,20,21 that some water models exhibit liquid–liquid transitions and others do not. However, recent work22,23 has argued that the liquid–liquid transition has been mistakenly interpreted, and is in fact a liquid–crystal transition in all atomistic models of water. Here we show, by studying the liquid–liquid transition in the ST2 model of water24 with the use of six advanced sampling methods to compute the free-energy surface, that two metastable liquid phases and a stable crystal phase exist at the same deeply supercooled thermodynamic condition, and that the transition between the two liquids satisfies the thermodynamic criteria of a first-order transition25. We follow the rearrangement of water’s coordination shell and topological ring structure along a thermodynamically reversible path from the low-density liquid to cubic ice26. We also show that the system fluctuates freely between the two liquid phases rather than crystallizing. These findings provide unambiguous evidence for a liquid–liquid transition in the ST2 model of water, and point to the separation of time scales between crystallization and relaxation as being crucial for enabling it.