Sartoretti, PKatz, DCropper, MarkPanuzzo, PSeabroke, G. MViala, YBenson, KBlomme, RJasniewicz, GJean-Antoine, AHuckle, HZerjal, Marusa2019-04-172019-04-170004-6361http://hdl.handle.net/1885/160439Context. The Gaia Data Release 2 (DR2) contains the first release of radial velocities complementing the kinematic data of a sample of about 7 million relatively bright, late-type stars. Aims. This paper provides a detailed description of the Gaia spectroscopic data processing pipeline, and of the approach adopted to derive the radial velocities presented in DR2. Methods. The pipeline must perform four main tasks: (i) clean and reduce the spectra observed with the Radial Velocity Spectrometer (RVS); (ii) calibrate the RVS instrument, including wavelength, straylight, line-spread function, bias non-uniformity, and photometric zeropoint; (iii) extract the radial velocities; and (iv) verify the accuracy and precision of the results. The radial velocity of a star is obtained through a fit of the RVS spectrum relative to an appropriate synthetic template spectrum. An additional task of the spectroscopic pipeline was to provide first-order estimates of the stellar atmospheric parameters required to select such template spectra. We describe the pipeline features and present the detailed calibration algorithms and software solutions we used to produce the radial velocities published in DR2. Results. The spectroscopic processing pipeline produced median radial velocities for Gaia stars with narrow-band near-IR magnitude GRVS ≤ 12 (i.e. brighter than V ~ 13). Stars identified as double-lined spectroscopic binaries were removed from the pipeline, while variable stars, single-lined, and non-detected double-lined spectroscopic binaries were treated as single stars. The scatter in radial velocity among different observations of a same star, also published in Gaia DR2, provides information about radial velocity variability. For the hottest (Teff ≥ 7000 K) and coolest (Teff ≤ 3500 K) stars, the accuracy and precision of the stellar parameter estimates are not sufficient to allow selection of appropriate templates. The radial velocities obtained for these stars were removed from DR2. The pipeline also provides a first-order estimate of the performance obtained. The overall accuracy of radial velocity measurements is around ~200–300 m s−1, and the overall precision is ~1 km s−1; it reaches ~200 m s−1 for the brightest stars.application/pdfen-AUThe Authorshttp://creativecommons.org/licenses/by/4.0Processing the spectroscopic data201810.1051/0004-6361/2018328362019-03-12Open Access article, published by EDP Sciences, under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.