Liver cancer is the most common cancer in Khon Kaen, Northeast Thailand, because of the high incidence of cholangiocarcinoma (CHCA). Opisthorchis viverrini (OV), a liver fluke, is endemic in the area, and has been evaluated as a cause of CHCA by International Agency for Research on Cancer. Residents of 20 districts in the province were invited to attend a mobile screening programme between 1990 and 2001. Of 24 723 participants, 18 393 aged 35–69 years were tested for OV infection, by examining stools for the presence of eggs. Prevalence of infection in each district was estimated from the sample of the population who had been tested. The incidence of liver cancer in 1990–2001 was obtained for each district from the cancer registry. The average crude prevalence of OV infection in the sample subjects was 24.5%, ranging from 2.1% to 70.8% in different districts. Truncated age-standardized incidence of CHCA at ages >35 years varied threefold between districts, from 93.8 to 317.6 per 100 000 person-years. After adjustment for age group, sex and period of sampling, there was a positive association between prevalence of OV infection and incidence of CHCA at the population level. Associations between CHCA and active OV infection in individuals have become hard to demonstrate, because of effective anti-OV treatment. The relationship may, however, be clear in comparisons between populations, which, for infectious diseases, take into account the contextual effects of group exposure in determining individual outcome. The cancer registry is an appropriate tool for disease monitoring in small areas.