During the last glacial period, the Laurentide Ice Sheet sporadically discharged huge numbers of icebergs through the Hudson Strait into the North Atlantic Ocean, leaving behind distinct layers of ice-rafted debris in the ocean sediments1,2,3. Perplexingly, these massive discharge events—Heinrich events—occurred during the cold portion of millennial-scale climate oscillations called Dansgaard–Oeschger cycles2,4. This is in contrast to the expectation that ice sheets expand in colder climates and shrink in warmer climates. Here we use an ice sheet model to show that the magnitude and timing of Heinrich events can be explained by the same processes that drive the retreat of modern marine-terminating glaciers. In our model, subsurface ocean warming associated with variations in the overturning circulation increases underwater melt along the calving face, triggering rapid margin retreat and increased iceberg discharge. On millennial timescales, isostatic adjustment causes the bed to uplift, isolating the terminus from subsurface warming and allowing the ice sheet to advance again until, at its most advanced position, it is poised for another Heinrich event. This mechanism not only explains the timing and magnitude of observed Heinrich events, but also suggests that ice sheets in contact with warming oceans may be vulnerable to catastrophic collapse even with little atmospheric warming.