For most of their existence, stars are fuelled by the fusion of hydrogen into helium. Fusion proceeds via two processes that are well understood theoretically: the proton-proton (pp) chain and the carbon-nitrogen-oxygen (CNO) cycle1,2. Neutrinos that are emitted along such fusion processes in the solar core are the only direct probe of the deep interior of the Sun. A complete spectroscopic study of neutrinos from the pp chain, which produces about 99 per cent of the solar energy, has been performed previously3; however, there has been no reported experimental evidence of the CNO cycle. Here we report the direct observation, with a high statistical significance, of neutrinos produced in the CNO cycle in the Sun. This experimental evidence was obtained using the highly radiopure, large-volume, liquid-scintillator detector of Borexino, an experiment located at the underground Laboratori Nazionali del Gran Sasso in Italy. The main experimental challenge was to identify the excess signal—only a few counts per day above the background per 100 tonnes of target—that is attributed to interactions of the CNO neutrinos. Advances in the thermal stabilization of the detector over the last five years enabled us to develop a method to constrain the rate of bismuth-210 contaminating the scintillator. In the CNO cycle, the fusion of hydrogen is catalysed by carbon, nitrogen and oxygen, and so its rate—as well as the flux of emitted CNO neutrinos—depends directly on the abundance of these elements in the solar core. This result therefore paves the way towards a direct measurement of the solar metallicity using CNO neutrinos. Our findings quantify the relative contribution of CNO fusion in the Sun to be of the order of 1 per cent; however, in massive stars, this is the dominant process of energy production. This work provides experimental evidence of the primary mechanism for the stellar conversion of hydrogen into helium in the Universe.