Primordial nucleosynthesis after the Big Bang can be constrained by the abundances of the light elements and isotopes 2H, 3He, 4He and 7Li (ref. 1). The standard theory of stellar evolution predicts that 3He is also produced by solar-type stars, so its abundance is of interest not only for cosmology, but also for understanding stellar evolution and the chemical evolution of the Galaxy. The 3He abundance in star-forming (HII) regions agrees with the present value for the local interstellar medium, but seems to be incompatible with the stellar production rates inferred from observations of planetary nebulae, which provide a direct test of stellar evolution theory. Here we develop our earlier observations, which, when combined with recent theoretical developments in our understanding of light-element synthesis and destruction in stars, allow us to determine an upper limit for the primordial abundance of 3He relative to hydrogen: 3He/H = (1.1 +/- 0.2) × 10-5. The primordial density of all baryons determined from the 3He data is in excellent agreement with the densities calculated from other cosmological probes. The previous conflict is resolved because most solar-mass stars do not produce enough 3He to enrich the interstellar medium significantly.