Borexino was the first experiment to detect solar neutrinos in real-time in the sub-MeV region. In order to achieve high precision in the determination of neutrino rates, the detector design includes an internal and an external calibration system. This paper describes both calibration systems and the calibration campaigns that were carried out in the period between 2008 and 2011. We discuss some of the results and show that the calibration procedures preserved the radiopurity of the scintillator. The calibrations provided a detailed understanding of the detector response and led to a significant reduction of the systematic uncertainties in the Borexino measurements.