Mycoplasma gallisepticum (MG) causes chronic non-fatal diseases in the poultry industry with a remarkable decrease in feed consumption, egg production and other production indices. To study the genetic characteristics of MG isolates in commercial and backyard poultry flocks, 21 positive samples from different regions of Iran were analysed in the period 2012–2017. Typical macroscopic and histopathological lesions of the upper respiratory tract and lungs were found, similar to those reported by other researchers. A 298–361 bp part of the mgc2 gene was sequenced and analysed. Based on the phylogenetic analysis, the Iranian MG isolates fell into four distinct subgroups. The nucleotide difference between subgroups 1 and 4 was remarkable (91.6–94.9%). A 22-amino-acid insertion was present in two of the studied MG isolates, not observed in other vaccine and standard MG strains. The Iranian Veterinary Organisation (IVO) should consider the observed diversity of prevalent MG isolates from both commercial and backyard flocks in designing the strategy for controlling MG. More studies are needed to understand modifications in MG antigenicity and pathogenicity because of the observed genetic variations.