We studied the influence of population structure at the microgeographical level on the analysis of forensic cases. A total of nine autosomal STRs and seven Y-STRs were analyzed in the general mixed population and in two relatively isolated valleys of Cantabria, a region in Northern Spain. Statistically significant differences existed in the frequency distribution of four autosomal STRs, with an overall Fst value of 0.3%. A simulation of virtual trio cases revealed that it did not have a practical influence on the analysis of paternity disputes. Significant differences also existed in most Y-STRs, with an overall Fst value of 3%. Thus, using the general database instead of the specific valley database resulted in 5-fold or higher overestimation of the likelihood ratio of matching in up to 30% of cases. A bayesian analysis revealed that this had a significant impact on the estimation of the probability of identity in scenarios of low "a priori" odds of suspicion.