A new measurement of the primary cosmic-ray proton and helium fluxes from 3 to 350 GeV was carried out by the balloon-borne CAPRICE experiment in 1998. This experimental setup combines different detector techniques and has excellent particle discrimination capabilities allowing clear particle identification. Our experiment has the capability to determine accurately detector selection efficiencies and systematic errors associated with them. Furthermore, it can check for the first time the energy determined by the magnet spectrometer by using the Cherenkov angle measured by the RICH detector well above 20 GeV n -1. The analysis of the primary proton and helium components is described here and the results are compared with other recent measurements using other magnet spectrometers. The observed energy spectra at the top of the atmosphere can be represented by (1.27±0.09)×10 4E-2.75±0.02 particles (m 2 GeV sr s) -1, where E is the kinetic energy in GeV, for protons between 20 and 350 GeV and (4.8±0.8)×10 2E-2.67±0.03 particles (m 2 GeV n -1 sr s) -1, where E is the kinetic energy in GeV per nucleon, for helium nuclei between 15 and 150 GeV n -1.