The environmental and trophic conditions of cities often give rise to very large populations of urban pigeons Columba livia f. domestica, which can cause local health and heritage problems due to accumulations of their droppings. Estimating the size of pigeon populations and defining their spatial patterns of abundance are therefore crucial for effective pigeon management in built-up areas. This article estimates the abundance of pigeons in Pamplona and the factors that explain the variability of pigeon abundance at local level. The Random Forest model of abundance at a local scale of 0.25 km2 cells had very high explanatory power, although its predictive power decreased due to this species’ gregariousness. Abundance decreased with increasing distance from the city centre, and from historic buildings and large parks, but increased as the proportion of the area covered by parks and built-up areas increased. The rock pigeon population in Pamplona was estimated at 8,030 individuals (95% CI: 6,483–9,860). The estimated density of urban pigeons for Pamplona as a whole was, on average, 218 birds/km2, although this figure varied considerably between habitats and areas: the highest values were measured in urban areas with historic buildings (exceeding 600 individuals/km2; in 35.8% of the 0.25 km2 cells, more than 200 individuals were estimated). Pigeon densities fell to ca. 250 birds/km2 in urban areas lacking large parks or green spaces whether near or far from historic buildings. In the peri-urban areas (i.e. arable fields, scrub and woodland), densities decreased to around 10–50 individuals/km2. In the city of Pamplona, although the population density of urban pigeons did not reach the numbers observed in other northern Spanish cities such as Barcelona, the habitat preference patterns in urban gradients are consistent with those documented in other European regions. We identify specific urban areas for population control and recommend measures such as feeding bans and waste and facade management to make it difficult for urban pigeons to access roosting and breeding sites in buildings.