Indian populations possess an exclusive genetic profile primarily due to the many migratory events, which caused an extensive range of genetic diversity, and also due to stringent and austere sociocultural barriers that structure these populations into different endogamous groups. In the present study we attempt to explore the genetic relationships between various endogamous North Indian populations and to determine the effect of stringent social regulations on their gene pool. Twenty STR markers were genotyped in 1,800 random North Indians from 9 endogamous populations belonging to upper-caste and middle-caste Hindus and Muslims. All nine populations had high allelic diversity (176 alleles) and average observed heterozygosity (0.742 +/- 0.06), suggesting strong intrapopulation diversity. The average F(ST) value over all loci was as low as 0.0084. However, within-group F(ST) and genetic distance analysis showed that populations of the same group were genetically closer to each other. The genetic distance of Muslims from middle castes (F(ST) = 0.0090; DA = 0.0266) was significantly higher than that of Muslims from upper castes (F(ST) = 0.0050; DA = 0.0148). Phylogenetic trees (neighbor-joining and maximum-likelihood) show the basal cluster pattern of three clusters corresponding to Muslims, upper-caste, and middle-caste populations, with Muslims clustered with upper-caste populations. Based on the results, we conclude that the extensive gene flow through a series of migrations and invasions has created an enormous amount of genetic diversity. The interpopulation differences are minimal but have a definite pattern, in which populations of different socioreligious groups have more genetic similarity within the same group and are genetically more distant from populations of other groups. Finally, North Indian Muslims show a differential genetic relationship with upper- and middle-caste populations.