Pathogens are major drivers of cancer globally. Quantifying the relationship between infection and carcinogenesis is therefore crucial for developing preventative programs. The foodborne trematode Opisthorchis viverrini is a primary cause of biliary cancer (cholangiocarcinoma) and infects 12 million people in Southeast Asia. In tumours from patients exposed to O. viverrini we found that the earliest chromosomal amplification of driver genes occurred at 30 years old on average, two to four decades before cancer diagnosis, and disproportionately contained FGFR2, TP53 and PTEN genes. We fitted transmission models to parasitological data from Thailand spanning 27 years (n = 11,517) finding that, for people born between 1960–1989, first exposure occurred at two years old and by 30 years individuals had been cumulatively infected with a median of 72 worms. Trematodes are long–lived and our analysis quantifies the average lifespan of O. viverrini as 13 years (90% credible interval [CrI] 6–23 years) within human hosts. Finally, we calculate the lifetime probability of diagnosis with cholangiocarcinoma as 1.2% (90% CrI 1.0–1.4%) given prior exposure to the parasite.