Unlike spiral galaxies such as the Milky Way, the majority of the stars in massive elliptical galaxies were formed in a short period early in the history of the Universe. The duration of this formation period can be measured using the ratio of magnesium to iron abundance ([Mg/Fe]) in spectra, which reflects the relative enrichment by core-collapse and type Ia supernovae. For local galaxies, [Mg/Fe] probes the combined formation history of all stars currently in the galaxy, including younger and metal-poor stars that were added during late-time mergers. Therefore, to directly constrain the initial star-formation period, we must study galaxies at earlier epochs. The most distant galaxy for which [Mg/Fe] had previously been measured is at a redshift of z ≈ 1.4, with [Mg/Fe] = . A slightly earlier epoch (z ≈ 1.6) was probed by combining the spectra of 24 massive quiescent galaxies, yielding an average [Mg/Fe] = 0.31 ± 0.12 (ref. 7). However, the relatively low signal-to-noise ratio of the data and the use of index analysis techniques for both of these studies resulted in measurement errors that are too large to allow us to form strong conclusions. Deeper spectra at even earlier epochs in combination with analysis techniques based on full spectral fitting are required to precisely measure the abundance pattern shortly after the major star-forming phase (z > 2). Here we report a measurement of [Mg/Fe] for a massive quiescent galaxy at a redshift of z = 2.1, when the Universe was three billion years old. With [Mg/Fe] = 0.59 ± 0.11, this galaxy is the most Mg-enhanced massive galaxy found so far, having twice the Mg enhancement of similar-mass galaxies today. The abundance pattern of the galaxy is consistent with enrichment exclusively by core-collapse supernovae and with a star-formation timescale of 0.1 to 0.5 billion years-characteristics that are similar to population II stars in the Milky Way. With an average past star-formation rate of 600 to 3,000 solar masses per year, this galaxy was among the most vigorous star-forming galaxies in the Universe.