The principal component analyses (PCAs) of ancient and modern-day populations were computed based on haplogroup frequencies (Supplementary Tables S5 and S6). PCA of 21 ancient populations showed a predominant difference between European and Asian populations, which indicates a clustering of the medieval populations of Europe, as well as the assembly of Avars, conquerors and further Mediterranean populations (Fig. 3a, Supplementary Fig. S1). Although the East Asian medieval populations were clearly separated from the European contemporaneous period on both PCA and Ward clustering, prehistoric Central Asian (Kazakhstan) and North Asian (Siberian Late Bronze Age Baraba) populations showed similarities to the conquest-period dataset in both analyses (Fig. 3b). The three Carpathian Basin populations were compared with populations from most of the ancient North European and medieval Asian populations, showing significant differences in haplogroup composition (p < 0.05). On the other hand, prehistoric Central Asian, south central Siberian (Minusinsk Hollow) and Baraba populations were not significantly different from the populations of the Carpathian Basin, and these affinities are also reflected in the clustering tree (Supplementary Table S5, Fig. 3b).