Salmonella is one of the most important foodborne pathogens worldwide. Its main reservoirs are poultry and pigs, in which infection is endemic in many countries. Spain has one of the largest pig populations in the world. Even though Salmonella infection is commonly detected in pig farms, its spatial distribution at the national level is poorly understood. Here we aimed to report the spatial distribution of Salmonella-positive pig farms in Spain and investigate the presence of potential spatial trends over a 17-year period. For this, data on samples from pigs tested for Salmonella in 2002–2013, 2015, 2017, and 2019 as part of the Spanish Veterinary Antimicrobial Resistance Surveillance program, representing 3,730 farms were analyzed. The spatial distribution and clustering of Salmonella-positive pig farms at the province level were explored using spatial empirical Bayesian smoothing and global Moran’s I, local Moran’s I, and the Poisson model of the spatial scan statistics. Bayesian spatial regression using a reparameterized Besag-York-Mollié Poisson model (BYM2 model) was then performed to quantify the presence of spatially structured and unstructured effects while accounting for the effect of potential risk factors for Salmonella infection at the province level. The overall proportion of Salmonella-positive farms was 37.8% (95% confidence interval: 36.2–39.4). Clusters of positive farms were detected in the East and Northeast of Spain. The Bayesian spatial regression revealed a West-to-East increase in the risk of Salmonella infection at the province level, with 65.2% (50% highest density interval: 70–100.0%) of this spatial pattern being explained by the spatially structured component. Our results demonstrate the existence of a spatial variation in the risk of Salmonella infection in pig farms at the province level in Spain. This information can help to optimize risk-based Salmonella surveillance programs in Spain, although further research to identify farm-level factors explaining this pattern are needed.