The present analysis continues the study of 12 samples of 11 Hungarian ethnic groups and a collection of data from 8 foreign reference populations. The origin of these groups is entangled with the history of Hungary and specifically with the conquest of the Carpathian basin in the ninth century A.D. Given that each of the 11 groups has preserved its ethnic identity and assuming that genetic drift has played a major role, we expect that similarities and differences between the different Hungarian groups and between the Hungarian groups and the eight reference populations can be interpreted with respect to the controversial origin of the groups. The reference populations are those whose ancestors had high involvement in Hungarian history. We use multivariate statistical methods to analyze the gene frequencies of 22 loci. The results show that the Hungarian ethnic groups are genetically separate and that this separation is related to different migration waves. According to our results, Gypsies and Jews, who migrated relatively recently to Hungary, are distant from the other groups and, as predicted, appear to be genetically close to the North Indian and Ashkenazi reference populations, respectively. The Oriental population is least related to the Hungarian groups, but the distance diminishes when the P1 locus, which shows particularly high variability, is included. Some ethnic groups, especially Orség and Csángó, show genetic isolation and specific affinities with the reference populations that are related to their origin, namely, Slavs and Finns-Turks-Iranians, respectively. Other affinities were less striking than tradition would lead us to expect. Gene flow and admixture, as revealed by the significant correlation between genetic and geographic distances, may have played an important role in smoothing genetic differences between groups.