Massive disk galaxies like the Milky Way are expected to form at late times in traditional models of galaxy formation, but recent numerical simulations suggest that such galaxies could form as early as a billion years after the Big Bang through the accretion of cold material and mergers. Observationally, it has been difficult to identify disk galaxies in emission at high redshift, in order to discern between competing models of galaxy formation. Here we report imaging, with a resolution of about 1.3 kiloparsecs, of the 158-micrometre emission line from singly ionized carbon, the far-infrared dust continuum and the near-ultraviolet continuum emission from a galaxy at a redshift of 4.2603, identified by detecting its absorption of quasar light. These observations show that the emission arises from gas inside a cold, dusty, rotating disk with a rotational velocity of 272 kilometres per second. The detection of emission from carbon monoxide in the galaxy yields a molecular mass that is consistent with the estimate from the ionized carbon emission of about 72 billion solar masses. The existence of such a massive, rotationally supported, cold disk galaxy when the Universe was only 1.5 billion years old favours formation through either cold-mode accretion or mergers, although its large rotational velocity and large content of cold gas remain challenging to reproduce with most numerical simulations.