Despite twenty years of research, the phase diagram of high-transition-temperature superconductors remains enigmatic1, 2. A central issue is the origin of the differences in the physical properties of these copper oxides doped to opposite sides of the superconducting region. In the overdoped regime, the material behaves as a reasonably conventional metal, with a large Fermi surface3, 4. The underdoped regime, however, is highly anomalous and appears to have no coherent Fermi surface, but only disconnected 'Fermi arcs'5, 6. The fundamental question, then, is whether underdoped copper oxides have a Fermi surface, and if so, whether it is topologically different from that seen in the overdoped regime. Here we report the observation of quantum oscillations in the electrical resistance of the oxygen-ordered copper oxide YBa2Cu3O6.5, establishing the existence of a well-defined Fermi surface in the ground state of underdoped copper oxides, once superconductivity is suppressed by a magnetic field. The low oscillation frequency reveals a Fermi surface made of small pockets, in contrast to the large cylinder characteristic of the overdoped regime. Two possible interpretations are discussed: either a small pocket is part of the band structure specific to YBa2Cu3O6.5 or small pockets arise from a topological change at a critical point in the phase diagram. Our understanding of high-transition-temperature (high-Tc) superconductors will depend critically on which of these two interpretations proves to be correct.