  The majority of massive disk galaxies in the local Universe show a stellar
barred structure in their central regions, including our Milky Way. Bars are
supposed to develop in dynamically cold stellar disks at low redshift, as the
strong gas turbulence typical of disk galaxies at high redshift suppresses or
delays bar formation. Moreover, simulations predict bars to be almost absent
beyond $z = 1.5$ in the progenitors of Milky Way-like galaxies. Here we report
observations of ceers-2112, a barred spiral galaxy at redshift $z_{\rm phot}
\sim 3$, which was already mature when the Universe was only 2 Gyr old. The
stellar mass ($M_{\star} = 3.9 \times 10^9 M_{\odot}$) and barred morphology
mean that ceers-2112 can be considered a progenitor of the Milky Way, in terms
of both structure and mass-assembly history in the first 2 Gyr of the Universe,
and was the closest in mass in the first 4 Gyr. We infer that baryons in
galaxies could have already dominated over dark matter at $z \sim 3$, that
high-redshift bars could form in approximately 400 Myr and that dynamically
cold stellar disks could have been in place by redshift $z = 4-5$ (more than 12
Gyrs ago).
