The extremely rapid assembly of the earliest galaxies during the first billion years of cosmic history is a major challenge for our understanding of galaxy formation physics1–5. The advent of the James Webb Space Telescope (JWST) has exacerbated this issue by confirming the existence of galaxies in substantial numbers as early as the first few hundred million years6–8. Perhaps even more surprisingly, in some galaxies, this initial highly efficient star formation rapidly shuts down, or quenches, giving rise to massive quiescent galaxies as little as 1.5 billion years after the Big Bang9,10. However, due to their faintness and red colour, it has proven extremely challenging to learn about these extreme quiescent galaxies, or to confirm whether any existed at earlier times. Here we report the spectroscopic confirmation of a massive quiescent galaxy, GS-9209, at redshift, z = 4.658, just 1.25 billion years after the Big Bang, using the JWST Near-Infrared Spectrograph (NIRSpec). From these data we infer a stellar mass of M* = 3.8 ± 0.2 × 1010 M⊙, which formed over a roughly 200 Myr period before this galaxy quenched its star-formation activity at $$z={6.5}_{-0.5}^{+0.2}$$
z
=
6.5
−
0.5
+
0.2
, when the Universe was approximately 800 Myr old. This galaxy is both a likely descendent of the highest-redshift submillimetre galaxies and quasars, and a likely progenitor for the dense, ancient cores of the most massive local galaxies.