Mining installations are releasing toxic substances into the environment which could pose a health problem to populations in their vicinity. We sought to investigate whether there might be excess cancer-related mortality in populations residing in towns lying in the vicinity of Spanish mining industries governed by the Integrated Pollution Prevention and Control Directive, and the European Pollutant Release and Transfer Register Regulation, according to the type of extraction method used. An ecologic study was designed to examine municipal mortality due to 32 types of cancer, across the period 1997 through 2006. Population exposure to pollution was estimated on the basis of distance from town of residence to pollution source. Poisson regression models, using the Bayesian conditional autoregressive model proposed by Besag, York and Molliè and Integrated Nested Laplace Approximations for Bayesian inference, were used: to analyze risk of dying from cancer in a 5-kilometer zone around mining installations; effect of type of industrial activity; and to conduct individual analyses within a 50-kilometer radius of each installation. Excess mortality (relative risk, 95% credible interval) of colorectal cancer (1.097, 1.041–1.157), lung cancer (1.066, 1.009–1.126) specifically related with proximity to opencast coal mining, bladder cancer (1.106, 1.016–1.203) and leukemia (1.093, 1.003–1.191) related with other opencast mining installations, was detected among the overall population in the vicinity of mining installations. Other tumors also associated in the stratified analysis by type of mine, were: thyroid, gallbladder and liver cancers (underground coal installations); brain cancer (opencast coal mining); stomach cancer (coal and other opencast mining installations); and myeloma (underground mining installations). The results suggested an association between risk of dying due to digestive, respiratory, hematologic and thyroid cancers and proximity to Spanish mining industries. These associations were dependent on the type of mine.