© 2015 Martínez et al. Background: Portugal and Spain, with six and 22 officially recognized caprine breeds, encompass 25 % of the European Union goat census. Many of these populations have suffered strong demographic declines because of competition with exotic breeds and the phasing-out of low income rural activities. In this study, we have investigated the consequences of these and other demographic processes on the genetic diversity, population structure and inbreeding levels of Iberian and Atlantic goats. Methods: A sample of 975 individuals representing 25 officially recognized breeds from Portugal and Spain, two small populations not officially recognized (Formentera and Ajuí goats) and two ecotypes of the Tinerfenã and Blanca Celtibérica breeds were genotyped with a panel of 20 microsatellite markers. A wide array of population genetics methods was applied to make inferences about the genetic relationships and demography of these caprine populations. Results: Genetic differentiation among Portuguese and Spanish breeds was weak but significant (FST = 0.07; P < 0.001), which is probably the consequence of their short splitting times and extensive gene flow due to transhumance. In contrast, Canarian goats were strongly differentiated because of prolonged geographic isolation. Most populations displayed considerable levels of diversity (mean He = 0.65). Conclusions: High diversity levels and weak population structures are distinctive features of Portuguese and Spanish breeds. In general, these local breeds have a reduced census, but are still important reservoirs of genetic diversity. These findings reinforce the need for the implementation of management and breeding programs based on genetic data in order to minimize inbreeding, maintain overall genetic and allelic diversities and breed identities, while at the same time taking into account the within-breed genetic structure.