Emergent bulk properties of matter governed by the strong nuclear force give rise to physical phenomena across vastly different scales, ranging from the shape of atomic nuclei to the masses and radii of neutron stars. They can be accessed on Earth by measuring the spatial extent of the outer skin made of neutrons that characterizes the surface of heavy nuclei. The isotope ^{208}Pb, owing to its simple structure and neutron excess, has been in this context the target of many dedicated efforts. Here, we determine the neutron skin from measurements of particle distributions and their collective flow in ^{208}Pb+^{208}Pb collisions at ultrarelativistic energy performed at the Large Hadron Collider, which are mediated by interactions of gluons and thus sensitive to the overall size of the colliding ^{208}Pb ions. By means of state-of-the-art global analysis tools within the hydrodynamic model of heavy-ion collisions, we infer a neutron skin Δr_{np}=0.217±0.058 fm, consistent with nuclear theory predictions, and competitive in accuracy with a recent determination from parity-violating asymmetries in polarized electron scattering. We establish thus a new experimental method to systematically measure neutron distributions in the ground state of atomic nuclei.