© 2019, The Author(s). There is extensive debate regarding the protective effect of 3-hydroxy-3-methylglutaryl-coenzyme A reductase inhibitors (statins) on colorectal cancer (CRC). We aimed to assess the association between CRC risk and exposure to statins using a large cohort with prescription data. We carried out a case-control study in Catalonia using the System for Development of Primary Care Research (SIDIAP) database that recorded patient diseases history and linked data on reimbursed medication. The study included 25 811 cases with an incident diagnosis of CRC between 2010 and 2015 and 129 117 frequency-matched controls. Subjects were classified as exposed to statins if they had ever been dispensed statins. Analysis considering mean daily defined dose, cumulative duration and type of statin were performed. Overall, 66 372 subjects (43%) were exposed to statins. There was no significant decrease of CRC risk associated to any statin exposure (OR = 0.98; 95% CI: 0.95–1.01). Only in the stratified analysis by location a reduction of risk for rectal cancer was observed associated to statin exposure (OR = 0.87; 95% CI: 0.81–0.92). This study does not support an overall protective effect of statins in CRC, but a protective association with rectal cancer merits further research.