The Sumatra-Andaman earthquake of 26 December 2004 is the first giant earthquake (moment magnitude Mw > 9.0) to have occurred since the advent of modern space-based geodesy and broadband seismology. It therefore provides an unprecedented opportunity to investigate the characteristics of one of these enormous and rare events. Here we report estimates of the ground displacement associated with this event, using near-field Global Positioning System (GPS) surveys in northwestern Sumatra combined with in situ and remote observations of the vertical motion of coral reefs. These data show that the earthquake was generated by rupture of the Sunda subduction megathrust over a distance of >1,500kilometres and a width of <150kilometres. Megathrust slip exceeded 20metres offshore northern Sumatra, mostly at depths shallower than 30kilometres. Comparison of the geodetically and seismically inferred slip distribution indicates that ~30 per cent additional fault slip accrued in the 1.5 months following the 500-second-long seismic rupture. Both seismic and aseismic slip before our re-occupation of GPS sites occurred on the shallow portion of the megathrust, where the large Aceh tsunami originated. Slip tapers off abruptly along strike beneath Simeulue Island at the southeastern edge of the rupture, where the earthquake nucleated and where an Mw = 7.2 earthquake occurred in late 2002. This edge also abuts the northern limit of slip in the 28 March 2005 Mw = 8.7 Nias-Simeulue earthquake.