Many glaciers along the margins of the Greenland and Antarctic ice sheets are accelerating and, for this reason, contribute increasingly to global sea-level rise(1-7). Globally, ice losses contribute similar to 1.8 mm yr(-1) (ref. 8), but this could increase if the retreat of ice shelves and tidewater glaciers further enhances the loss of grounded ice(9) or initiates the large-scale collapse of vulnerable parts of the ice sheets(10). Ice loss as a result of accelerated flow, known as dynamic thinning, is so poorly understood that its potential contribution to sea level over the twenty-first century remains unpredictable(11). Thinning on the ice-sheet scale has been monitored by using repeat satellite altimetry observations to track small changes in surface elevation, but previous sensors could not resolve most fast-flowing coastal glaciers(12). Here we report the use of high-resolution ICESat (Ice, Cloud and land Elevation Satellite) laser altimetry to map change along the entire grounded margins of the Greenland and Antarctic ice sheets. To isolate the dynamic signal, we compare rates of elevation change from both fast-flowing and slow-flowing ice with those expected from surface mass-balance fluctuations. We find that dynamic thinning of glaciers now reaches all latitudes in Greenland, has intensified on key Antarctic grounding lines, has endured for decades after ice-shelf collapse, penetrates far into the interior of each ice sheet and is spreading as ice shelves thin by ocean-driven melt. In Greenland, glaciers flowing faster than 100 m yr(-1) thinned at an average rate of 0.84 m yr(-1), and in the Amundsen Sea embayment of Antarctica, thinning exceeded 9.0 m yr(-1) for some glaciers. Our results show that the most profound changes in the ice sheets currently result from glacier dynamics at ocean margins.