Galaxies are believed to have formed a large proportion of their stars in giant bursts of star formation early in their lives, but when and how this took place are still very uncertain. The presence of large amounts of dust in quasars and radio galaxies at redshifts z > 4 shows that some synthesis of heavy elements had already occurred at this time. This implies that molecular gas--the building material of stars--should also be present, as it is in galaxies at lower redshifts (z approximately = 2.5, refs 7-10). Here we report the detection of emission from dust and carbon monoxide in the radio-quiet quasar BR1202 - 0725, at redshift z = 4.69. Maps of these emissions reveal two objects, separated by a few arc seconds, which could indicated either the presence of a companion to the quasar or gravitational lensing of the quasar itself. Regardless of the precise interpretation of the maps, the detection of carbon monoxide confirms the presence of a large mass of molecular gas in one of the most distant galaxies known, and shows that conditions conducive to huge bursts of star formation existed in the very early Universe