The ages of the oldest stars in the Galaxy indicate when star formation began, and provide a minimum age for the Universe. Radioactive dating of meteoritic material and stars relies on comparing the present abundance ratios of radioactive and stable nuclear species to the theoretically predicted ratios of their production. The radioisotope 232Th (half-life 14Gyr) has been used to date Galactic stars, but it decays by only a factor of two over the lifetime of the Universe. 238U (half-life 4.5Gyr) is in principle a more precise age indicator, but even its strongest spectral line, from singly ionized uranium at a wavelength of 385.957nm, has previously not been detected in stars. Here we report a measurement of this line in the very metal-poor star CS31082-0018, a star which is strongly overabundant in its heavy elements. The derived uranium abundance, log(U/H) = -13.7 +/- 0.14 +/- 0.12 yields an age of 12.5 +/- 3Gyr, though this is still model dependent. The observation of this cosmochronometer gives the most direct age determination of the Galaxy. Also, with improved theoretical and laboratory data, it will provide a highly precise lower limit to the age of the Universe.