A measurement of the negative muon flux in the atmosphere has been made using a superconducting magnet spectrometer during the ascent part of a balloon flight experiment performed on September 5, 1989 from Prince Albert, Saskatchewan (Canada). The negative muon component has been measured over the momentum range 0.3-40 GeV/c with an altitude increasing from 0.6 to 36 km above sea level. This is the first time that results from such wide intervals in momentum and atmospheric depth have been obtained using a single apparatus. The flux growth curve with atmospheric depth is momentum dependent; the low energy muon flux peaks around 150 g/cm(2) and higher energy muons penetrate to larger depths in the atmosphere. The flux decreases exponentially with increasing depth above 200 g/cm(2). The attenuation length Lambda(e) increases almost linearly with the muon momentum at a rate of about 90 (g/cm(2))/(GeV/c) in the 0.3-8 GeV/c range. The momentum spectra at different altitudes can be described by power-laws, provided that the spectral index is left free to change with altitude. We found that an index value of -2.5 +/- 0.2 can give a good description of the data for momenta between 2 and 40 GeV/c in the depth range 20-400 g/cm(2). Below 1 GeV/c, the spectrum gradually steepens as the atmospheric depth decreases. Above 600 g/cm(2) a peak around 0.5 GeV/c arises.