Understanding the population genetic consequences of habitat heterogeneity requires assessing whether patterns of gene flow correspond to landscape configuration. Studies of the genetic structure of populations are still scarce for Neotropical forest birds. We assessed range-wide genetic structure and contemporary gene flow in the thorn-tailed rayadito (Aphrastura spinicauda), a passerine bird inhabiting the temperate forests of South America. We used 12 microsatellite loci to genotype 582 individuals from eight localities across a large latitudinal range (30°S-56°S). Using population structure metrics, multivariate analyses, clustering algorithms, and Bayesian methods, we found evidence for moderately low regional genetic structure and reduced gene flow towards the range margins. Genetic differentiation increased with geographic distance, particularly in the southern part of the species' distribution where forests are continuously distributed. Populations in the north seem to experience limited gene flow likely due to forest discontinuity, and may comprise a demographically independent unit. The southernmost population, on the other hand, is genetically depauperate and different from all other populations. Different analytical approaches support the presence of three to five genetic clusters. We hypothesize that the genetic structure of the species follows a hierarchical clustered pattern.