Asteroid 4 Vesta seems to be a major intact protoplanet, with a surface composition similar to that of the HED (howardite-eucrite-diogenite) meteorites. The southern hemisphere is dominated by a giant impact scar, but previous impact models have failed to reproduce the observed topography. The recent discovery that Vesta's southern hemisphere is dominated by two overlapping basins provides an opportunity to model Vesta's topography more accurately. Here we report three-dimensional simulations of Vesta's global evolution under two overlapping planet-scale collisions. We closely reproduce its observed shape, and provide maps of impact excavation and ejecta deposition. Spiral patterns observed in the younger basin Rheasilvia, about one billion years old, are attributed to Coriolis forces during crater collapse. Surface materials exposed in the north come from a depth of about 20 kilometres, according to our models, whereas materials exposed inside the southern double-excavation come from depths of about 60-100 kilometres. If Vesta began as a layered, completely differentiated protoplanet, then our model predicts large areas of pure diogenites and olivine-rich rocks. These are not seen, possibly implying that the outer 100 kilometres or so of Vesta is composed mainly of a basaltic crust (eucrites) with ultramafic intrusions (diogenites).