Classical swine fever (CSF) is one of the most important re-emergent swine diseases worldwide. Despite concerted control efforts in the Andean countries, the disease remains endemic in several areas, limiting production and trade opportunities. In this study, we aim to determine herd-level risk factors and spatiotemporal implications associated with CSF. We analysed passive surveillance datasets and vaccination programmes from 2014 to 2020; Then, structured a herd-level case-control study using a multivariable logistic model containing 339 cases, and a spatiotemporal Bayesian model, considering 115 thousand premises, 2.3 million annual vaccine doses and a population of 1.6 million pigs distributed in 1,006 parishes. Our results showed that the risk factors that increased the odds of CSF occurrence were swill feeding (OR 9.28), time of notification (OR 2.18), animal entry in the last 30 days (OR 2.08), lack of CSF vaccination (OR 1.88), age of animals between 3-6 months (OR 1.58) and being in the coastal region (OR 1.87). Spatiotemporal models showed that the vaccination campaign reduced the risk by 33% while temperature increased the risk by 17%. The calculated priority index aims to facilitate the intervention process that should be focused on a couple of provinces, mainly in Morona Santiago and Los Rios as well as in specific parishes around the country. Our findings provide insight and understanding of the risk factors associated with CSF in Ecuador, which stands for the Andean region; even though the results are specific for the implementation of risk-based surveillance for CSF, data and methods could be valuable for the prevention and control of diseases such as African swine fever, or porcine reproductive and respiratory syndrome. In conclusion, the results highlight the complexity of the CSF control programme, the need to inform decision-makers, involve stakeholders and implement better strategies to update continental health policies to eradicate swine diseases.