Antiparticles account for a small fraction of cosmic rays and are known to be produced in interactions between cosmic-ray nuclei and atoms in the interstellar medium, which is referred to as a `secondary source'. Positrons might also originate in objects such as pulsars and microquasars or through dark matter annihilation, which would be `primary sources'. Previous statistically limited measurements of the ratio of positron and electron fluxes have been interpreted as evidence for a primary source for the positrons, as has an increase in the total electron+positron flux at energies between 300 and 600GeV (ref. 8). Here we report a measurement of the positron fraction in the energy range 1.5-100GeV. We find that the positron fraction increases sharply over much of that range, in a way that appears to be completely inconsistent with secondary sources. We therefore conclude that a primary source, be it an astrophysical object or dark matter annihilation, is necessary.