Unravelling the volcanic history of the enigmatic lunar farside is essential for understanding the hemispheric dichotomy of the Moon1–3. Cratering chronology established for the lunar nearside has been used to suggest long-lived volcanism on the farside of the Moon3,4 but without sample verification. We describe two episodes of basaltic volcanism identified by Pb–Pb dating of basalt fragments returned by the Chang’e-6 mission. One high-Al basalt fragment, dated at 4,203 ± 4 million years ago (Ma), has a source 238U/204Pb ratio (µ value) of approximately 1,620, implying a KREEP-rich (K, rare earth elements and P) source for this oldest-known example of basaltic volcanism among returned samples. The main volcanic episode of the Chang’e-6 basalt documents a surprisingly young eruption age of 2,807 ± 3 Ma, which has not been observed on the nearside of the Moon. The initial Pb isotope compositions of these younger basalts indicate a derivation from a source with a µ value of approximately 360, indicating a KREEP-poor mantle source. Mare volcanism on the lunar farside thus persisted for over 1.4 billion years, even if the source was depleted in heat-producing elements. The consistency between the 2.8-billion-year basalt age and the crater-counting age indicates that the cratering chronology model established for the lunar nearside is also applicable to the farside of the Moon.