Rapid warming over the past 50 years on the Antarctic Peninsula is associated with the collapse of a number of ice shelves and accelerating glacier mass loss1, 2, 3, 4, 5, 6, 7. In contrast, warming has been comparatively modest over West Antarctica and significant changes have not been observed over most of East Antarctica8, 9, suggesting that the ice-core palaeoclimate records available from these areas may not be representative of the climate history of the Antarctic Peninsula. Here we show that the Antarctic Peninsula experienced an early-Holocene warm period followed by stable temperatures, from about 9,200 to 2,500 years ago, that were similar to modern-day levels. Our temperature estimates are based on an ice-core record of deuterium variations from James Ross Island, off the northeastern tip of the Antarctic Peninsula. We find that the late-Holocene development of ice shelves near James Ross Island was coincident with pronounced cooling from 2,500 to 600 years ago. This cooling was part of a millennial-scale climate excursion with opposing anomalies on the eastern and western sides of the Antarctic Peninsula. Although warming of the northeastern Antarctic Peninsula began around 600 years ago, the high rate of warming over the past century is unusual (but not unprecedented) in the context of natural climate variability over the past two millennia. The connection shown here between past temperature and ice-shelf stability suggests that warming for several centuries rendered ice shelves on the northeastern Antarctic Peninsula vulnerable to collapse. Continued warming to temperatures that now exceed the stable conditions of most of the Holocene epoch is likely to cause ice-shelf instability to encroach farther southward along the Antarctic Peninsula.