In the sample of male residents of St. Petersburg, Y-chromosome haplogroups were determined by genotyping 18 STR Y-chromosome (DYS389I, DYS389II, DYS390, DYS19, DYS385A, DYS385B, DYS456, DYS437, DYS438, DYS447, DYS448, DYS449, DYS391, DYS392, DYS393, DYS439, DYS635 and DYS576) and data on genetic demography were collected by means of a questionnaire. The distribution of Y-chromosome haplogroups in St. Petersburg residents generally corresponds to the published data on Russian gene pool, with the most frequent haplogroups R1a, R1b, E1b1b1, N, T, I1, I2, J1 and J2, and with the predominance of haplogroup R1a. The presence of “southern by origin” haplogroups (C3, G2a, G2c, J1, J2, L, O2, O3, Q, R2 and T) entering the megalopolis with a flow of migrants, with a total frequency of 16% (in Moscow – 18.1%) was noted. A comparative analysis of the frequency distributions of Y-chromosome haplogroups in residents of St. Petersburg and Moscow revealed statistically significant differences in the frequency of haplogroup E1b1b1, and differences in the ratio of I1 and I2, determined by geographic position. Based on the survey data, a sample of Russian men who had no ancestors of another ethnicity in the male line in the two previous generations was formed. Significant differences in the frequency of “southern-origin” haplogroups were established between the initial sample of residents of St. Petersburg (16%) and the sample of men with Russian ancestors in two previous generations (4.1%). The obtained result confirms the spectrum of haplogroups of “southern origin” as penetrating into the gene pool of the population of a megalopolis with migrant flows and indicates the need for genetic and demographic questionnaires when forming reference databases for a megalopolis, as well as for their timely updating due to changes in the gene pool under the influence of migration.