  Magnetic fields are prevalent on almost all astronomical scales, but their
importance in different systems and over cosmic time is yet to be understood.
Our current knowledge on the evolution of magnetic fields is limited by scarce
observations in the distant Universe, where galaxies have recently been found
to be more evolved than most of our model predictions. In this study, we
conduct rest-frame 131 $\mu$m full-polarisation ALMA observations of dust
emission in a strongly lensed dusty star-forming galaxy, SPT0346-52, at z=5.6,
when the Universe was only 1 Gyr old. Dust grains can become aligned with local
magnetic fields, resulting in the emission of linearly polarised thermal
infrared radiation. Our observations have revealed a median polarisation level
of 0.9$\pm$0.2 per cent with a variation of $\pm$0.4 per cent across the
regions with polarisation detection, similar to that of local starburst
galaxies. The polarised dust emission is patchy. It mostly overlaps with the [C
II] emission at a velocity of about -150 km/s, and extends over 3 kiloparsecs
with a bimodal distribution in position angles. Our analysis indicates that the
kpc-scale polarised dust is most likely aligned by the large-scale magnetic
fields associated with a galaxy merger. If the ordered fields are confirmed to
be coherent, such early detection of large-scale magnetic fields favours an
efficient formation of magnetic fields in primordial galaxies, which highlights
the importance of magnetic fields in mediating galaxy evolution over long
cosmic timescales. Future surveys towards a wider galaxy population are
necessary to test the ubiquitousness of large-scale magnetic fields in early
galaxies.
