Molecular epidemiological features of Mycobacterium tuberculosis strains among different patient groups in Russia have not been studied well. The aim of our study was to compare the genotypes of M. tuberculosis strains circulating among tuberculosis (TB) patients from different groups: homeless, human immunodeficiency virus (HIV)-infected, prisoners, and the general population of St. Petersburg citizens. One hundred and forty-two M. tuberculosis complex isolates from different TB patient groups were studied using the spacer oligonucleotide typing (spoligotyping) method. The majority of the studied M. tuberculosis isolates in all groups belonged to the Beijing family (55% among homeless; 77% among HIV-infected; 60% among the general population; 81% among prisoners). There were no significant differences in the Beijing family prevalence among homeless patients, HIV/TB co-infected patients, and the general population of TB patients. The lowest genetic diversity of the pathogen was detected among imprisoned patie