Using the same set of microsatellite markers, we compared the population genetic structure of two Mastomys species, one being exclusively commensal in southeastern Senegal, and the other being continuously distributed outside villages in this region. Both species were sampled in the same landscape context and at the same spatial scale. According to the expectations based on the degree of habitat patchiness (which is higher for commensal populations in this rural area), genetic diversity was lower and genetic differentiation was higher in commensal populations of Mastomys natalensis than in wild populations of Mastomys erythroleucus. Contrasting estimates of effective dispersal and current migration rates corroborates previous data on differences in social structure between the two species. Isolation-by-distance analyses showed that human-mediated dispersal is not a major factor explaining the pattern of genetic differentiation for M. natalensis, and that gene flow is high and random between M. erythroleucus populations at the spatial scale considered.