Molecular hydrogen (H2) is an important component of galaxies because it fuels star formation and the accretion of gas onto active galactic nuclei (AGN), the two processes that can generate the large infrared luminosities of gas-rich galaxies. Observations of spectral-line emission from the tracer molecule carbon monoxide (CO) are used to probe the properties of this gas. But the lines that have been studied in the local Universe-mostly the lower rotational transitions of J = 1 --> 0 and J = 2 --> 1-have hitherto been unobservable in high-redshift galaxies. Instead, higher transitions have been used, although the densities and temperatures required to excite these higher transitions may not be reached by much of the gas. As a result, past observations may have underestimated the total amount of molecular gas by a substantial amount. Here we report the discovery of large amounts of low-excitation molecular gas around the infrared-luminous quasar APM08279+5255 at redshift z = 3.91, using the two lowest excitation lines of 12 CO (J = 1 --> 0 and J = 2 --> 1). The maps confirm the presence of hot and dense gas near the nucleus, and reveal an extended reservoir of molecular gas with low excitation that is 10 to 100 times more massive than the gas traced by the higher-excitation observations. This raises the possibility that significant amounts of low-excitation molecular gas may exist in the environments of high-redshift (z > 3) galaxies.