We report the first measurement of the deuterium abundance in cosmic rays above 10 GeV nucleon-1 of kinetic energy. The data were collected by the balloon-borne experiment CAPRICE98, which was flown on 1998 May 28-29 from Fort Sumner, New Mexico. The detector configuration included the NMSU-WiZard/CAPRICE superconducting magnet spectrometer equipped with a gas RICH detector, a silicon-tungsten calorimeter, and a time-of-flight system. By combining the information from the spectrometer and the RICH detector, it was possible to separate deuterons from protons in the kinetic energy range from 12 to 22 GeV nucleon-1. In order to estimate the proton background and the deuteron selection efficiency, we developed an empirical model for the response of the instrument, based on the data collected in this experiment. The analysis procedure is described in this paper, and the result on the absolute flux of deuterium is presented. We found that the deuterium abundance at high energy is consistent with the hypothesis that the propagation mechanism of light nuclei is the same as that of heavier secondary components.