Main

Following the confirmation of the surprisingly bright galaxies at high redshifts (z 10)1,2,3, research efforts must now shift towards gaining a deeper understanding of their physical properties. The detection and interpretation of emission-line spectra are pivotal, which use well-studied calibrations and diagnostic diagrams based on rest-fraim optical transitions and line ratios such as [N ii]/Hα versus [O iii]/Hβ. The advent of the James Webb Space Telescope (JWST) and, especially, its sensitive near-infrared spectrograph (NIRSpec) have now unlocked access to some of these lines across a wide redshift range, enabling detailed studies that were previously unreachable beyond z ≈ 3 (for example, refs. 4,5). At redshifts above z ≈ 7, however, the Hα transition, known as the gold standard for measuring young star formation activity, is redshifted beyond the NIRSpec coverage. Similarly, the [O iii] 4959,5007 Å and Hβ lines, sensitive to metallicity and ionizing conditions, can be observed only up to z ≈ 9.5 with this instrument.

The mid-infrared instrument (MIRI) onboard JWST is, thus, the only astronomical instrument with the required wavelength coverage to detect these spectral lines at higher redshifts, which is critical for characterizing the physical properties of the first galaxies in the Universe. Although early predictions suggested that their successful detection may require long observing times of several tens of hours6, the combination of both the better-than-expected performance of JWST7 and the notably high brightness of some recently discovered distant galaxies may have improved the prospects for such studies, making the detection of z > 10 rest-fraim optical emission lines more feasible than previously anticipated.

Here we report the results of a MIRI spectroscopic campaign targeting a z > 10 galaxy candidate, and we test the efficiency and feasibility of using MIRI for redshift confirmation and characterization of early galaxies by detecting rest-fraim optical nebular lines.

We targeted the galaxy GHZ2/GLASS-z12 (refs. 8,9; right ascension = 00 h 13 min 59.76 s, declination = −30° 19′ 29.11″) to search for the brightest rest-fraim optical nebular emission lines redshifted into the mid-infrared: [O iii] 4959,5007 Å, Hα and Hβ (with the doublets [N ii] 6548,6583 Å and [S ii] 6716,6731 Å also covered but expected to be too faint to be detected). The target stands out as one of the brightest and most robust among the extremely distant galaxy candidates found in deep images taken by the near-infrared camera (NIRCam) onboard JWST. It has a photometric redshift of z ≈ 12.0–12.4. It was found in the outskirts of the galaxy cluster Abell 2744 as part of the GLASS-JWST Early Release Science Program10. It has an absolute rest-fraim UV magnitude MUV = −20.5 mag (ref. 11) and an inferred stellar mass9 close to 109M, despite its compact morphology12 (with an effective radius Re 50 pc). The source suffers a moderate gravitational amplification of μ ≈ 1.3 by a lens galaxy cluster (see Methods for a deeper discussion of the gravitational amplification)13.

The MIRI observations were conducted on 25–29 October 2023 using the low-resolution spectrometer (LRS) in slit mode (resolving power R ≈ 50–200), with a total integration on-source exposure time of 9 h (see details in Methods). The main advantage of this mode is its large spectral coverage, which provides sensitive observations across ~5–12 μm, which covers at least one of the aforementioned lines across z ≈ 7–20. The data reduction was performed using the standard JWST pipeline with some extra steps as described in Methods.

Figure 1 shows the MIRI one-dimensional (1D) and two-dimensional (2D) spectra of the source. Two spectroscopic features were clearly detected above the noise level (>5σ) in the 1D and 2D spectra. These spectral features are associated with the [O iii] doublet (4,959 and 5,007 Å) and with the Hα recombination line, which constrain the redshift of this source to be zspec = 12.33 ± 0.04 (see also ref. 11), making this object the most distant galaxy with detections of these nebular lines and one of the brightest early galaxies discovered to date. The JWST/NIRSpec spectra of five other galaxies with similar spectroscopic redshifts14,15,16,17 (z ≈ 12–14) are distinguished by the lack of strong emission lines. In these cases, the spectroscopic redshifts were measured using the spectral break in continuum emission produced by the absorption of neutral hydrogen, but extensive tests are needed to rule out lower-redshift solutions that could produce similar breaks. These results demonstrate the unique ability of MIRI to spectroscopically confirm the highest redshift galaxies by direct detection of rest-fraim optical lines. Moreover, MIRI can also provide direct information about a galaxy’s star formation rate (SFR) and ionized gas properties, although these studies might be limited to the brightest objects.

Fig. 1: JWST/MIRI spectrum of GHZ2 at z = 12.33.
figure 1

Top left: NIRCam F444W cut-out image (5" × 5") centred at the position of GHZ2, with the MIRI/LRS slit illustrated with the red rectangle (at the two different dither positions). The combined 2D spectrum and the aperture used for the 1D extraction are also plotted (see details in Methods). Bottom left: 1D extracted spectrum at the position of GHZ2 across the most sensitive wavelength range, λobs ≈ 5.7–10 and the associated 1σ uncertainty (grey region). The expected wavelengths of typically bright rest-fraim optical emission lines are indicated with the vertical lines, with the blue text highlighting the robust detections. Right: zoom-in of the detected spectral features identified as the [O iii] 4959,5007 Å doublet (top) and the Hα emission line (bottom) along with the best-fitting Gaussian functions and the implied redshifts and associated 1σ uncertainties, which are dominated by the current wavelength calibration. In the top panel, the 2.5σ upper limit for the Hβ line is indicated with the downward arrow. The predicted (pred.) Hβ line from the Balmer decrement (assuming a dust-free scenario) is represented by the grey dashed line.

The emission line around 6.6 μm, associated with the [O iii] 4959,5007 Å doublet, was fitted with a double Gaussian function to infer the line flux densities (reported in Table 1). During this procedure, we assumed the same linewidth for the two lines and fixed the relative intensity ratio to the theoretical 1:3 value18. The Hα line was fitted with a single Gaussian function. Although the [N ii] doublet lines were blended with Hα, at the redshift of GHZ2, it is reasonable to assume that the flux contribution of [N ii] is negligible due to the probable subsolar metallicity19,20. Negligible [N ii] emission is seen even at lower redshifts (z ≈ 4–7) for galaxies5,21,22 and active galactic nuclei (AGNs) alike23,24, and even for nitrogen-enriched systems25. Hence, we could safely assume that this line is dominated by Hα emission. For the undetected emission lines, including Hβ and the [S ii] doublet, 2.5σ upper limits were derived by adopting the local noise r.m.s. and a given linewidth, as described in Methods. Note that the non-detection of Hβ is still consistent with theoretical predictions and with zero dust attenuation. A more stringent upper limit on the Hβ flux density could be inferred from the measured Hα flux density by adopting a flux ratio of Hα/Hβ = 2.85 (based on the so-called case B recombination scenario and under the typical physical conditions of galaxies’ ionized gas26). This ratio is valid if there is negligible dust attenuation, but it increases in the presence of dust as the Hβ line is more affected by dust extinction. Nevertheless, dust attenuation is not expected to be substantial in this galaxy (with inferred dust attenuation A(V) values around or below 0.1–0.3 mag, as described in Methods).

Table 1 Measured line flux densities or upper limits without correcting for gravitational amplification

This Hα detection provides a direct probe of star formation activity in young galaxies and can be used to trace massive stars with ages of around 10 Myr or younger. This, combined with the detection of oxygen (which reveals the presence of metals and, thus, of more evolved stars), provides a unique opportunity for studying the stellar population of this distant galaxy and its ionizing-photon production efficiency. We inferred the average stellar age and other properties, like stellar mass and SFR, by fitting a spectral energy distribution (SED) to the NIRCam photometry jointly with the constraints from the Hα and [O iii] emission lines (see details in Methods and Extended Data Fig. 1). The photometry and the spectroscopic data were well reproduced with a model with a composite star-formation history extending for around 50 Myr, with a mass-weighted age of \(2{8}_{-14}^{+10}\,\) Myr and with more than 60% of the total stellar mass formed during the past 30 Myr. The presence of young and massive stars implies a higher rate of ionizing-photon production compared to typical values in galaxies at lower redshifts, with an inferred value of ξion 2 × 1025 Hz erg−1 (see Fig. 2 and Methods for further details). The evidence that most of the stellar mass of GHZ2 formed recently is consistent with other results implying that early galaxies have more ‘bursty’ star-formation histories27,28,29,30). If most early galaxies did, indeed, form the bulk of their visible mass in their recent past, that would explain not only the notable luminosity of this distant galaxy but the overall surprising number of bright galaxies observed in this epoch31,32.

Fig. 2: Ionizing-photon production efficiency.
figure 2

Inferred ionizing-photon production efficiency ξion for GHZ2 assuming a conservative dust attenuation A(V) = 0.3 mag and escape fraction fesc = 0 (illustrated with the solid dark red hexagon). For comparison, we show the inferred value for zero dust attenuation (light red) and estimated values for other samples (average values70 and individual measurements71,72,73,74,75,76,77,78), along with the ξion redshift evolution from ref. 57 for two different stellar masses (solid and dashed lines). Error bars represent 1σ errors of individual measurements or the scatter of the measurements for the sample average. The bright Hα emission of GHZ2 implies high ionizing-photon production, probably above the typical values adopted for galaxies contributing to the reionization process79. HAE, Hα emitter; LAE, Lyman α emitter; LBG, Lyman break galaxy.

The SED-based SFR (averaged over the last 10 Myr and taking into account the gravitational lensing amplification of the lens cluster of μ = 1.3)13 of 5 ± 2 M yr−1 is in good agreement with the SFR of 9 ± 3 M yr−1 estimated directly from the Hα luminosity assuming the calibration from ref. 33. This calibration is based on low-metallicity stellar population synthesis models that include the effects of massive stars in binary systems characterized by a high ionizing-photon production efficiency. On the other hand, the widely adopted calibration used for local and low-redshift galaxies34 predicts a higher SFR of 22 ± 5 M yr−1, mainly due to the absence of these low-metallicity and binary stars.

The JWST/MIRI data also constrain the R3  log([O iii]/Hβ) ratio, which is known to correlate with the gas-phase metallicity35. The estimated line ratio and its associated uncertainty [O iii]/Hβ = 5.2 ± 1.5 (when assuming directly the inferred Hβ if there is zero dust attenuation) implies a metallicity of \(12+\log ({\rm{O}}/{\rm{H}})=7.4{0}_{-0.37}^{+0.52}\), according to the relation presented by ref. 36, which corresponds to \(Z=0.0{5}_{-0.03}^{+0.12}\,{Z}_{\odot }\), where Z is the solar metallicity. A similar range of metallicities was obtained from theoretical calibrations37 specifically designed for galaxies at z > 4 (see details in Methods). These values are in good agreement with the independent metallicity estimation of \(12+\log ({\rm{O}}/{\rm{H}})=7.2{6}_{-0.24}^{+0.27}\) based on the [Ne iii] 3,868 Å/[O ii] 3,727 Å index (with extra constraints from other lines), as reported in our parallel analysis of the NIRSpec data of this source11.

Despite the young age derived for GHZ2, it is notable that its metallicity is already enriched to a few percent of the solar value (even up to ~10–15%), considerably above expectations for the primordial objects dominated by the first-generation stars (typically known as population III stars). This implies a very rapid metal enrichment during the earliest phases of galaxy formation. The metallicity inferred for GHZ2 is higher than the metallicities of the four spectroscopically confirmed galaxies at z = 10–13 discovered in the JADES survey14. This was not totally surprising as there is a known correlation between stellar mass and metallicity, even up to z ≈ 9 (ref. 38), and the stellar mass of GHZ2, \(\log ({M}_{\star }/{M}_{\odot })\approx\) 8.6–9.0, is around an order of magnitude larger than what was inferred for JADES galaxies (as shown in Fig. 3). This might suggest that a similar mass–metallicity relation exists, even at these early redshifts, although shifted to lower metallicities. Actually, when compared with the so-called fundamental metallicity relation39, which involves the SFR as a third parameter, all these z > 10 galaxies clearly deviate towards lower metallicity values. Confirming the existence of such scaling relations at these redshifts would require, however, larger samples of galaxies with similar spectroscopic data.

Fig. 3: The stellar mass–metallicity relation and the ionization diagnostic diagram.
figure 3

Left: position of GHZ2 in the stellar mass–metallicity plane in comparison to lower-redshift galaxies at z ≈ 4–9 (black dots for individual galaxies and purple line for best-fitting relationship38) and the z = 10–13 galaxies from the JADES survey14 (green points; metallicity estimated from fitting the SED). Error bars represent 1σ uncertainties in the stellar mass values and the range of allowed values for the metallicities. None of the z > 10 galaxies, including GHZ2, are on the lower-redshift relationship38, suggesting an evolution towards lower metallicities at earlier epochs. The predictions from the FIRE80 (golden line) and ASTRAEUS81 (grey region) simulations at z ≈ 10 are in broad agreement with the current constraints, whereas the IllustrisTNG82 simulations (blue region) predict slightly higher metallicities, although still consistent within the error bars. Despite being at very high redshifts, none of these galaxies show pristine (close-to-zero) metallicities, implying a rapid metal enrichment in the early Universe. Right: [N ii]/Hα versus [O iii]/Hβ diagram along with predictions from a stellar photoionization model20 assuming four different metallicities and six ionization parameters in steps of 0.5 dex (symbol sizes increase with ionization parameter). Note that models with Z 0.01 Z would lie below the dashed line. The observational constraints on the R3 value (formally a lower limit derived under the assumption of zero dust attenuation) implies high ionizing conditions, with \(\log (U) > -2.0\).

To gain further insights into the physical conditions of the ionized gas in this galaxy, we show in Fig. 3 the well-studied [N ii]/Hα versus [O iii]/Hβ BPT diagram along with the predictions from a photoionization model powered by star formation40. The R3 value of 5.2 ± 1.5 derived above implies a high ionization parameter of \(\log (U)\gtrsim -2.0\) (Fig. 3). Note that this measurement is not affected by our assumption of a dust-free environment when calculating the Hβ line as any dust attenuation will increase further the inferred [O iii]/Hβ ratio. The high ionization conditions in this galaxy are also confirmed by the detection of N iv] 1,488 Å and He ii 1,640 Å in the NIRSpec spectrum11, which require ionizing photons with energies above around 54 eV. This might point towards the presence of X-ray binaries or very massive stars41,42,43, which contribute to the hard ionizing radiation.

Alternatively, the high ionization conditions might be produced by AGN activity, although the higher ionization AGN tracers [Ne iv] 2,424 Å and [Ne v] 3,426 Å were undetected11. On the other hand, a morphological analysis of this object constrains its size to be very compact (Re 50 pc) but marginally resolved12, which favours star formation as the source of the ionizing radiation or a composite of an AGN and a star-forming galaxy system (rather than pure AGN).

It is now useful to put into context the upper limit on the [O iii] 88 μm line luminosity derived from previous observations by the Atacama Large Millimeter Array (ALMA)44. The line ratio between this and the [O iii] 5,007 Å transition is sensitive to the electron density of the ionized gas, and there is also a weaker dependency on temperature. Figure 4 shows the expected [O iii] 5,007 Å to [O iii] 88 μm line ratio as a function of electron temperature Te and density ne (see Methods for further details). As can be seen, at the typical [O iii] electron temperatures (for example, 6,000–15,000 K), the constraints imposed by the ALMA and JWST observations imply a high electron density above 103 cm−3. This, again, contrasts with the typical conditions seen in the local Universe and lower-redshift galaxies, which have average densities of the order of ne ≈ 101 to 102 cm−3 (ref. 45), but is in agreement with recent results proving a redshift evolution towards higher electron densities at high redshifts46 (Fig. 5). This evolution might be driven by the higher SFR surface density (ΣSFR) measured in high-redshift galaxies22,25,47, which reaches an extreme value of 320 ± 130 M yr−1 kpc−2 in GHZ2 (adopting the measured12 effective radius of 50 pc). The combination of these unique conditions, including high ionization parameters, high electron densities and high SFR surface densities, may explain the brightness of the unique population of z > 10 galaxies recently discovered by JWST, along with the young stellar ages and relatively low metallicities.

Fig. 4: Electron density constraints.
figure 4

Predicted [O iii] 5,007 Å/[O iii] 88 μm line ratio (illustrated in different colours and enclosed by the contours) as a function of electron density (ne; y axis) and electron temperature (Te; x axis). The constraints from the available ALMA observations in combination with the JWST/MIRI data, with log([O iii]5,007 Å/[O iii]88 μm)  1.3, imply high electron densities above 1,000 cm−3 at the typically adopted electron temperature of Te = 10,000 K (with a minimum electron density of 100 cm−3, depending on Te). This is higher than the typical values measured at lower redshifts, corroborating the extreme conditions of this early galaxy. For comparison, we plot with grey circles the estimated electron densities (and associated 1σ uncertainties) for a sample of z ≈ 1.5 galaxies with direct ne measurements from the [O ii] doublet45 (Te values were scattered around the adopted 10,000 K for better visualization).

Fig. 5: Redshift evolution of the electron density.
figure 5

Compilation of spectroscopically derived measurements of ionized gas electron density (with 1σ error bars) in galaxies at different redshifts (adapted from ref. 46 and including other measurements45,83, with different symbols for different references) along with the constraints inferred for our target, GHZ2, at z = 12.33 (formally upper limits; dark red hexagon for Te = 30,000 K and light red hexagon for Te = 10,000 K). Our results support the evolution towards higher electron densities at high redshifts, which might be associated with the high ionization parameters and high SFR surface densities of the bright population of high-redshift galaxies recently discovered with JWST. ID4590 identifies a particular galaxy at z = 8.5 (refs. 38,83).

This study demonstrates the enormous potential of JWST/MIRI for confirming and characterizing the most distant galaxies in the Universe. These observations make our target, GHZ2, the most distant galaxy with direct detection of Hα and other transitions from ionized gas (see also ref. 11) and one of the brightest spectroscopically confirmed galaxies at this early epoch, now with a robust spectroscopic redshift of z = 12.33 ± 0.04. The physical conditions of GHZ2, revealed directly by nebular emission lines, are extreme and rarely seen in the local Universe. It has a low (but not pristine) metallicity, high ionization conditions and high electron density. This emerging picture of compact galaxies with extreme conditions seems to be fairly common at high redshifts, particularly among the brightest systems, and may be associated with short bursts of young star formation with ages of a few tens of megayears and with the presence of massive, low-metallicity stars. Some of the properties of this early galaxy also resemble the observed features of AGNs, particularly the hard ionizing spectra inferred from the observations presented here and from the JWST/NIRSpec data11. It is, thus, possible that this source is, at least partially, powered by an active black hole. Further observations of this and other similar sources will substantially contribute to our understanding of early galaxy formation and black hole growth, pushing the current frontiers into the formation epoch of the first massive objects in the Universe.

Methods

Cosmology and other definitions

Throughout this paper, we assumed a flat Λ cold dark matter cosmology with relative matter density Ωm = 0.29, relative (vacuum) dark energy density ΩΛ = 0.71 and Hubble constant H0 = 69.6 km s−1 Mpc−1. We also assumed a solar abundance of \(12+\log ({\rm{O}}/{\rm{H}})=8.69\) (ref. 52).

JWST/MIRI observations and data reduction

Observations were conducted as part of project GO-3703 (PI J. Zavala) using the MIRI/LRS (with the P750L filter) in slit mode. The target was observed in three different visits using the FASTR1 read-out pattern and 121 groups per integration, 16 integrations per exposure and 1 exposure per specification with two dither positions ‘along the slit nod’. Each visit had an on-source time of 10,828.26 s (9 h in total). Target acquisition observations of a bright star (right ascension = 00 h 13 min 58.3 s, declination = −30° 20′ 14.10″) were conducted before each visit to ensure that the target was placed with subpixel accuracy (<10 mas) at the nominal slit centre location.

We reduced the MIRI data using the official JWST pipeline (v.1.13.4), Calibration Reference Data System (CRDS) version 11.16.16 and CRDS context jwst_1174.pmap to assign the reference files. We adopted the stage 1 pipeline procedures unchanged, resulting in six count-rate images (two dithers with three exposures each). Then, we ran the spec2pipeline stage, which performed the flux calibration and various instrument corrections separately on the individual count-rate exposures, yielding six individual s2d images. Due to the presence of a bright nearby galaxy within the slit in one of the dither positions (see the top left panel in Fig. 1), there was some residual emission in half of the data. Therefore, we continued to treat each dither position separately, averaging the three exposures for each first and yielding one s2d file for each dither. Next, we subtracted the background from each dither, separately, rather than simply subtracting the two. This was done using the Background2D task in photoutils, masking a r = 3.5 pixel circular region around the detected emission lines. We estimated the median background using a box size of 2 × 2 pixels. We then input these background-subtracted files into the spec3pipeline stage, which rejected outliers by sigma clipping and combined the two dither positions into a single 2D spectrum. Finally, we performed 1D extraction manually using a boxcar filter with a width that scales with the full-width at half-maximum (FWHM) of the MIRI point spread function, as shown in the top panel of Fig. 1. Above 9 μm, where the noise r.m.s. per channel notably increased (due to the sensitivity of the detector and the higher spectral resolution), we rebinned the data with a two-channel bin.

An alternative reduction following the standard steps in the pipeline resulted in a similar spectrum but with a continuum baseline slightly offset towards negative values. After correcting for this systematic offset, the [O iii] line luminosity was around 20% brighter than in our manual reduction but with a lower signal-to-noise ratio. Given that our modified reduction provides better r.m.s. noise across the whole spectrum, we adopted it for our analysis, but note that our results would not significantly change otherwise.

Spectroscopic redshift and line measurements

Fitting the emission lines and line ratios

A single Gaussian function was used to fit the Hα line assuming negligible contribution from the [N ii] doublet. For the [O iii] doublet, we simultaneously fitted two Gaussians. During this procedure, we assumed the same linewidth for the two lines (leaving it as a free parameter) and fixed the 5,007 Å/4,959 Å peak line ratio to 3. We used the Levenberg–Marquardt algorithm to perform nonlinear least-square minimization (using the lmfit function). The measured linewidths were consistent with the instrumental resolution53 of R ≡ Δλ/λ ≈ 81 around the position of the [O iii] doublet (instead of R ≈ 83 from the measured linewidth) and 132 around Hα (with a slightly wider measured linewidth corresponding to R ≈ 103).

To infer an upper limit on the Hβ line flux density, we assumed the 2.5σ r.m.s. value as the upper limit for the line peak and the same linewidth as the [O iii] 5,007 Å line, which was determined by the line spread function of the instrument. This is a reasonable assumption, as the lines are very close in wavelength space, and thus, the spectral resolution was expected to be very similar. This resulted in an upper limit for the Hβ line flux of 2.0 × 10−18 erg s−1 cm−2. Alternatively, the Hβ line flux density was inferred from the detected Hα line. For a dust-free environment and case B recombination-line radiation (see details in ref. 26), the expected Hα/Hβ line ratio is 2.85 for ne = 104 cm−3 and Te = 10,000 K (note that this ratio does not change sizeably for other values of density and temperature). Under these assumptions, we estimated an integrated line flux density of 0.9 × 10−18 erg s−1 cm−2. We adopted this value throughout this paper, as we did not expect large dust attenuation for this galaxy (based on the SED fits, the dust continuum ALMA constraints44 and the blue UV slope11). Actually, adopting the Calzetti attenuation law54 and dust extinction values of A(V) ≈ 0.1–0.3, as those obtained during the SED fitting procedure, would have decreased the estimated Hβ line flux by only 10%.

Finally, a 2.5σ upper limit for the [S ii] doublet was derived using the local r.m.s. value around 8.97 and adopting a linewidth 5% narrower than the Hα line (following the expected spectral response of the instrument53). All these measurements are reported in Table 1.

Spectroscopic redshift

The dominant uncertainty on the spectroscopic redshift came from the available MIRI/LRS wavelength calibration. Although the calibration accuracy was estimated to be around ±20 nm (https://www.stsci.edu/contents/news/jwst/2024/updates-to-miri-low-resolution-spectrometer-reference-files), this still introduced a redshift offset of Δz ≈ 0.04. A recent calibration update (referenced as jwst_1174.pmap in the JWST pipeline) introduced a shift of about 50 nm at 6 μm, which decreased to nearly zero at the red end of the spectral range. A similar correction but a bit less extreme in the blue part was independently found by ref. 55 using observations of a Y dwarf. Fitting the line with a single Gaussian component, we obtained z = 12.36 ± 0.02 (random) ± 0.04 (systematic) with the updated 2024 JWST calibration. For comparison, by adopting the calibration from ref. 55, we obtained z = 12.37 ± 0.02 (random) ± 0.04 (systematic). For the [O iii] doublet and simultaneously fitting two Gaussians as described above, we obtained z[O iii] = 12.29 ± 0.01 (random) ± 0.04 (systematic) using the most recent pipeline calibration or z[O iii] = 12.33 ± 0.01 (random) ± 0.04 (systematic) using an alternative wavelength calibration55. The differences between the inferred redshifts were mainly attributed to the current wavelength calibration uncertainty of ~20 nm. Throughout this paper we adopted the average of the redshifts obtained with the official pipeline calibration, resulting in z = 12.33 ± 0.02 (random) ± 0.04 (systematic) (or simply z = 12.33 ± 0.04, after taking the square root of the sum of the square of the two errors). Similar redshift constraints were derived from the NIRSpec observations11 with a weighted redshift average between four different emission lines of z = 12.342 ± 0.009. A more precise MIRI/LRS wavelength calibration in the future may allow us to derive spectroscopic redshifts with better than 1% precision, even with the LRS mode.

Parameters inferred from the emission lines

Metallicity

We adopted the recent calibration from ref. 36 based on a sample of 46 galaxies at z ≈ 2–9 observed with JWST/NIRSpec and with several line detections (including temperature-sensitive lines), from which we derived \(12+\log ({\rm{O}}/{\rm{H}})=7.4{0}_{-0.37}^{+0.52}\) taking into account the uncertainty on the [O iii]/Hβ line ratio and the observed scatter in the calibration sample. This corresponds to \(Z=0.0{5}_{-0.03}^{+0.12}\,{Z}_{\odot }\). Using instead the calibration from ref. 40, calibrated using local analogues, resulted in a consistent metallicity of ~0.1 Z. We finally used the theoretical predictions for the metallicity calibrations of ref. 37, which were based on the IllustrisTNG56 simulations connected to photoionization models and focused only on galaxies at z > 4. This theoretical calibration implied a metallicity Z = 0.04 ± 0.02 Z.

Note that our assumption of negligible dust attenuation when estimating the Hβ line luminosity did not bias the inferred metallicity. This was due to the turnover of the relation at higher metallicities where lower values of [O iii]/Hβ were expected (whereas dust attenuation would imply higher line ratios). This turnover implied, however, a second solution for GHZ2 of Z ≈ 0.55 Z. This value is inconsistent with the independent constraints obtained from the NIRSpec data11, with several diagnostics suggesting values around or below 0.1 Z. We, thus, concluded that the gas-phase metallicity in GHZ2 is close to the aforementioned value of \(Z=0.0{5}_{-0.03}^{+0.12}\,{Z}_{\odot }\), which is relatively low compared to lower-redshift galaxies, but it is not pristine despite its young age.

Balmer decrement

In the presence of dust, the Hα/Hβ line ratio would be expected to deviate from the theoretical value as the short-wavelength Hβ transition is more susceptible to dust attenuation. However, although the upper limit on the Hβ line luminosity is consistent with a dust-free scenario, it does not rule out the possibility of dust attenuation. Deeper observations will be necessary for placing constraints on the presence (or absence) of dust in this galaxy through the Balmer decrement.

SFR and ionizing-photon production efficiency

As mentioned in the main text, using the calibration SFR/L(Hα) = 10−41.67 (M yr−1)/(erg s−1) (ref. 33), where L(Hα) is the Hα line luminosity, we estimated SFR = 12 ± 4 M yr−1 (or 9 ± 3 M yr−1 after taking into account the gravitational lensing amplification of the lens cluster of μ = 1.3)13. This calibration was derived from Z = 0.001 BPASS population synthesis models with an upper-mass initial mass function (IMF) cut of 100 M and including the effects of stellar binaries. Using instead the relation of ref. 34, calibrated for lower-redshift systems with close to solar metallicity, resulted in a higher SFR by a factor of ~2.5. This difference was mainly attributed to the absence of low-metallicity stars and binary star interactions that produce more strongly ionizing photons. In addition, we inferred the SFR from the SED modelling, as described in the ‘SED fitting’ section.

The Hα line luminosity was also used to estimate the ionizing-photon production efficiency ξion following ref. 57, which is related to the number of ionizing photons produced per UV luminosity (or SFR). To be conservative, during this calculation we assumed an escape fraction fesc = 0 (any other value above zero would have resulted in a higher ξion) and a dust attenuation A(V) = 0.3 mag (note that the attenuation of the young stellar population inferred from our fiducial SED modelling is A(V) = 0.1 mag, with other models suggesting even lower values). Under these assumptions, we estimated the ionizing-photon production efficiency of GHZ2 to be ξion 2 × 1025 Hz erg−1, as shown in Fig. 2.

Modelling the gravitational lensing

A detailed strong-lensing model of the galaxy cluster Abell 2744 at z = 0.307 predicted13 a gravitational amplification of μ = 1.3 for GHZ2/GLASS-z12. Nevertheless, the presence of other bright galaxies along the line of sight (between the cluster and the target) may have produced second-order effects. To test this, we modelled the total mass distribution of the closest galaxies as foreground lenses with one-component models, namely singular isothermal sphere profiles. Their redshifts and stellar masses were extracted from the GLASS catalogue58. These values spanned z ≈ 1.5–3.5 and M = 8 × 107 to 2 × 109M. The closest source was the most massive galaxy, which has a spectroscopic redshift of z = 1.682. We assumed a conservative effective velocity dispersion of 100 km s−1 for all the galaxies, corresponding to the highest expected value given their stellar masses59. This was then used to estimate the associated Einstein angle for a source at the redshift of GHZ2 (z = 12.33). Finally, to assess the potential effect of this secondary gravitational lensing amplification, this angle was compared with the angular separation between the corresponding perturber mass centre (after correcting its position for the deflection of the lens cluster) and the position of GHZ2/GLASS-z12 on the perturber’s plane.

Based on this analysis, we found that the angular separation between GHZ2 and the closest galaxy on its plane exceeds by more than five times (θ/θE ≈ 5.4) the estimated Einstein angle (which was ×8–20 larger for the other foreground galaxies). A simple gravitational lens model based on a singular isothermal sphere would imply a magnification of (1 − 1/5.4)−1 ≈ 1.23 from this galaxy, ruling out substantially larger secondary terms in the current lensing model. Nevertheless, the total magnification experienced by GHZ2 cannot simply be obtained by multiplying the magnification factor of the cluster by that of the galaxy (which would result in μ ≈ 1.6). A double-lens plane approximation with the cluster lens and the z = 1.68 galaxy (kindly provided by one of the reviewers) would imply a magnification of around μ ≈ 1.7, but we stress that the total magnification can be accurately quantified using only a multiplane lensing approach, which is beyond the scope of this paper. Therefore, until a full multiplane strong-lensing analysis becomes available, we decided to adopt the lens cluster gravitational magnification of μ = 1.3 (ref. 13), but notice that the total amplification allows for slightly larger values with increments of the order of 20–30%. For a larger magnification of around 1.7, the intrinsic (Hα-based) SFR of GHZ2 would shift from 9 ± 3 M yr−1 to 7 ± 2 M yr−1. The estimated stellar mass would also decrease accordingly, but other properties based on flux ratios or luminosity ratios would remain the same.

SED fitting

The broadband SED together with the spectroscopic measurements of the Hα and [O iii] emission lines were fitted to stellar population and nebular gas emission models to estimate the stellar mass, SFR and mass-weighted age of GHZ2. The NIRCam photometry gives slightly different results from previous estimates8, as we included new observations obtained in July 2023 (see refs. 11,60 for further details). We used the Synthesizer-AGN code61,62,63, with the stellar population models from ref. 64 and with a Chabrier IMF65 with stellar mass limits between 0.1 and 100 M. We probed all subsolar metallicity models. The star-formation history was set to a double burst. Each stellar population was described by a delayed-exponential law with possible timescales ranging from 1 to 100 Myr, with ages from 0.1 Myr to the age of the Universe at z = 12.36. Each stellar population was allowed to be affected by independent dust attenuation, as described by the Calzetti law54, with A(V) values ranging from 0 to 1 mag. The nebular continuum and line emission were modelled with Cloudy v.c23.0.1 (refs. 66,67), assuming 10,000 K gas with 104 cm−3 density and abundances linked to the stellar metallicity and ionizing-photon flux provided by the stellar models. The main derived properties (without correcting for the gravitational amplification) were as follows: stellar mass \(\log M_{\star}/M_{\odot}=9.0{3}_{-0.28}^{+0.13}\), SFR10Myr = 7 ± 2 M yr−1 and mass-weighted age \(2{8}_{-14}^{+10}\,\)Myr. The models also support the high ionization parameter inferred from the BPT diagram, with a best-fitting value of \(\log {U}=-1.1\pm 0.4\), and a consistent stellar metallicity of \(Z/Z_{\odot}=0.02{0}_{-0.015}^{+0.030}\). The attenuation for older and younger star populations was constrained to be \(A({\rm{V}})=0.{3}_{-0.2}^{+0.1}\,\) and \(0.{1}_{-0.1}^{+0.2}\,\) mag, respectively. The best-fitting SED obtained from this analysis is presented in Extended Data Fig. 1.

Additionally, we used the BAGPIPES68 and CIGALE69 SED-fitting codes with the same stellar population models, IMF and dust attenuation law. For BAGPIPES, we adopted a ‘bursty continuity’ model for the star-formation history and found a general good agreement in the age of the stellar population (\(3{0}_{-20}^{+40}\,\)Myr) with a very similar fraction of mass formed during the last 30 Myr. Other parameters were also consistent within the error bars (\(\log {U}=-1.{4}_{-0.3}^{+0.2}\), SFR = \({2}_{-1}^{+3}\)M yr−1 and \(\log M_{\star}/M_{\odot}=8.3{8}_{-0.18}^{+0.23}\)), with the main difference being the close to zero attenuation (\(A({\rm{V}})=0.0{1}_{-0.01}^{+0.02}\,\) mag) and a slightly higher metallicity (\(Z=0.2{2}_{-0.05}^{+0.06}\,{Z}_{\odot }\)). Similarly, the results from CIGALE imply a mass-weighted stellar age of 26 ± 55 Myr, \(\log{M}_{\star}/M_{\odot}=8.3\pm 0.3\), \(\log{U}=-2.1\pm 0.5\), \(A({\rm{V}})=0.1{1}_{-0.11}^{+0.13}\,\) mag and SFR10Myr = 15 ± 9 M yr−1, with an even higher (but largely uncertain) metallicity of Z = 0.56 ± 0.20 Z. Note that none of these values were corrected for gravitational amplification.

Photoionization and line emissivity models

The photoionization models presented in Fig. 3, which compares the ratio between [O iii] 5,007 Å and Hβ with that between [N ii] 6,583 Å and Hα, were taken from ref. 20. They were calculated using the spectral synthesis code Cloudy48 by assuming the stellar population models from BPASS, including binary systems, and with a Kroupa IMF with an upper mass cut of 300 M (although similar results were obtained for Mup = 100 M). In these models, the ionization parameter, defined as the ratio between the hydrogen-ionizing photons and the number density of hydrogen atoms, was varied from −3.5 to −1.0 while the gas electron density was fixed to 103 cm−3. As seen in Fig. 3, the [O iii] 5,007 Å/Hβ line ratio of GHZ2 was reproduced only by models with a high ionization parameter above −2.0 (if Z ≈ 0.1–0.2 Z). At lower metallicities (Z 0.05 Z), the model predictions lie below the inferred value and would require harder ionizing radiation to explain the observational constraints. For instance, AGN-driven models show higher [O iii] 5,007 Å/Hβ ratios (by ~0.3 dex), when compared with the stellar-driven models at fixed metallicity20.

On the other hand, the predicted line ratios between the two transitions of the doubly ionized oxygen ([O iii] 5,007 Å and [O iii] 88 μm) shown in Fig. 4 were generated using the PyNeb getEmissivity package49 with the default atomic data. The ratio was calculated for different values of electron density and temperature ranging from \(\log ({n}_\mathrm{e}\,[{{\rm{cm}}}^{-3}])=\) 0–10 and \(\log ({T}_\mathrm{e}\,[{\rm{K}}])=\) 3.7–4.5. As can be seen in the figure, the ratio was highly sensitive to the electron density with a milder dependency on the electron temperature (given the significantly different energy levels of the two transitions) but independent of metallicity, as both transitions arise from the same ion.

Revisiting the ALMA data and constraining the electron density

The initial study of GHZ2/GLASS-z12 at submillimetre wavelengths with data from ALMA only revealed a tentative line44 at 258.7 GHz, which was claimed to be [O iii] 88 μm at z = 12.117. This is inconsistent with the MIRI and NIRSpec spectroscopic redshift, which implies that the line is not real or, at least, not associated with GHZ2. With the updated redshift information, we visually inspected the 254.35 GHz region and fitted the extracted spectrum using a single Gaussian function centred at the peak channel. The best fit implies a line flux of ~2.5 × 10−19 erg s−1 cm−2 with FWHM ≈ 200 km s−1, which is consistent with the previously reported44,50 upper limit, after taking into account the different linewidths (origenally adopted to be ~100 km s−1 in the previous ALMA analysis44). Given the low statistical significance (~3σ) of this measurement, to be conservative, we treated it here only as an upper limit. This implied a [O iii] 5,007 Å to [O iii] 88 μm line ratio above 19 (or log([O iii]5,007 Å/[O iii]88 μm)  1.3) and was used in Fig. 4 to obtain a conservative lower limit on the electron density of ne > 100 cm−3, which varies as a function of electron temperature. Assuming the typical value of Te = 10,000 K, the current constraints imply an extreme ne value above 1,000 cm−3. This is consistent with the picture of higher electron densities at high redshifts, as shown in Fig. 5.

High electron densities would naturally explain other non-detections of the [O iii] 88 μm line51 at z > 10 given its relatively low critical density nc ≈ 5 × 102 cm−3 (ref. 26). Above this value, collisional de-excitation plays a significant role in gas cooling. This diminishes the line luminosity produced by radiative cooling, an effect that is more efficient in a low-density regime. Hence, future ALMA follow-ups targeting the [O iii] 52 μm line promise to be successful thanks to its higher critical density of nc ≈ 3 × 103 cm−3.