The discovery of metal-poor stars (where metal is any element more massive than helium) has enabled astronomers to probe the chemical enrichment history of the Milky Way. More recently, element abundances in gas inside high-redshift galaxies has been probed through the absorption lines imprinted on the spectra of background quasars, but these have typically yielded measurements of only a few elements. Furthermore, interpretation of these abundances is complicated by the fact that differential incorporation of metals into dust can produce an abundance pattern similar to that expected from nucleosynthesis by massive stars. Here we report the observation of over 25 elements in a galaxy at redshift z = 2.626. With these data, we can examine nucleosynthetic processes independent of the uncertainty arising from depletion. We find that the galaxy was enriched mainly by massive stars (M > 15 solar masses) and propose that it is the progenitor of a massive elliptical galaxy. The detailed abundance patterns suggest that boron is produced through processes that act independently of metallicity, and may require alternative mechanisms for the nucleosynthesis of germanium.