The West Antarctic Ice Sheet is one of the largest potential sources of rising sea levels. Over the past 40 years, glaciers flowing into the Amundsen Sea sector of the ice sheet have thinned at an accelerating rate, and several numerical models suggest that unstable and irreversible retreat of the grounding line - which marks the boundary between grounded ice and floating ice shelf - is underway. Understanding this recent retreat requires a detailed knowledge of grounding-line history, but the locations of the grounding line before the advent of satellite monitoring in the 1990s are poorly dated. In particular, a history of grounding-line retreat is required to understand the relative roles of contemporaneous ocean-forced change and of ongoing glacier response to an earlier perturbation in driving ice-sheet loss. Here we show that the present thinning and retreat of Pine Island Glacier in West Antarctica is part of a climatically forced trend that was triggered in the 1940s. Our conclusions arise from analysis of sediment cores recovered beneath the floating Pine Island Glacier ice shelf, and constrain the date at which the grounding line retreated from a prominent seafloor ridge. We find that incursion of marine water beyond the crest of this ridge, forming an ocean cavity beneath the ice shelf, occurred in 1945 (±12 years); final ungrounding of the ice shelf from the ridge occurred in 1970 (±4 years). The initial opening of this ocean cavity followed a period of strong warming of West Antarctica, associated with El Niño activity. Thus our results suggest that, even when climate forcing weakened, ice-sheet retreat continued.