Context : The carbon monoxide ( CO ) ro-vibrational emission from discs around Herbig Ae stars and T Tauri stars with strong ultraviolet emissions suggests that fluorescence pumping from the ground X ^ { 1 } \Sigma ^ { + } to the electronic A ^ { 1 } \Pi state of CO should be taken into account in disc models . Aims : We wish to understand the excitation mechanism of CO ro-vibrational emission seen in Herbig Ae discs , in particular in transitions involving highly excited rotational and vibrational levels . Methods : We implemented a CO model molecule that includes up to 50 rotational levels within nine vibrational levels for the ground and A -excited states in the radiative-photochemical code ProDiMo . We took CO collisions with hydrogen molecules ( H _ { 2 } ) , hydrogen atoms ( H ) , helium ( He ) , and electrons into account . We estimated the missing collision rates using standard scaling laws and discussed their limitations . We tested the effectiveness of UV fluorescence pumping for the population of high-vibrational levels ( v =1–9 , J =1–50 ) for four Herbig Ae disc models ( disc mass M _ { \mathrm { disc } } =10 ^ { -2 } , 10 ^ { -4 } and inner radius R _ { \mathrm { disc } } =1 , 20 AU ) . We tested the effect of infrared ( IR ) pumping on the CO vibrational temperature and the rotational population in the ground vibrational level . Results : UV fluorescence and IR pumping impact on the population of ro-vibrational v > 1 levels . The v = 1 rotational levels are populated at rotational temperatures between the radiation temperature around 4.6 \mu m and the gas kinetic temperature . The UV pumping efficiency increases with decreasing disc mass . The consequence is that the vibrational temperatures T _ { \mathrm { vib } } , which measure the relative populations between the vibrational levels , are higher than the disc gas kinetic temperatures ( suprathermal population of the vibrational levels ) . The effect is more important for low-density gases because of lower collisional de-excitations.The UV pumping is more efficient for low-mass ( M _ { \mathrm { disc } } < 10 ^ { -3 } M _ { \odot } ) than high-mass ( M _ { \mathrm { disc } } > 10 ^ { -3 } M _ { \odot } ) discs . Rotational temperatures from fundamental transitions derived using optically thick ^ { 12 } CO v = 1 - 0 lines do not reflect the gas kinetic temperature . Uncertainties in the rate coefficients within an order of magnitude result in variations in the CO line fluxes up to 20 % . CO pure rotational levels with energies lower than 1000 K are populated in LTE but are sensitive to a number of vibrational levels included in the model . The ^ { 12 } CO pure rotational lines are highly optically thick for transition from levels up to E _ { \mathrm { upper } } =2000 K. The model line fluxes are comparable with the observed line fluxes from typical HerbigAe low- and high-mass discs . Conclusions :