Deformation and melting of the crust during the formation of large impact craters must have been important during the Earth's early evolution, but such processes remain poorly understood1. The 1.8-billion-year-old Sudbury structure2in Ontario, Canada, is greater than 200 km in diameter and preserves a complete impact section, including shocked basement rocks, an impact melt sheet and fallback material3,4. It has generally been thought that the most voluminous impact melts represent the average composition of the continental crust4, but here we show that the melt sheet now preserved as the Sudbury Igneous Complex is derived predominantly from the lower crust. We therefore infer that the hypervelocity impact caused a partial inversion of the compositional layering of the continental crust. Using geochemical data, including platinum-group-element abundances, we also show that the matrix of the overlying clast-laden Onaping Formation represents a mixture of the original surficial sedimentary strata, shock-melted lower crust and the impactor itself.