It has long been speculated that erm and ksgA are related evolutionarily due to their sequence similarity and analogous catalytic reactions. We performed a comprehensive phylogenetic analysis with extensive Erm and KsgA/Dim1 sequences (Dim1 is the eukaryotic ortholog of KsgA). The tree provides insights into the evolutionary history of erm genes, showing early bifurcation of the Firmicutes and the Actinobacteria, and suggesting that the origin of the current erm genes in pathogenic bacteria cannot be explained by recent horizontal gene transfer from antibiotic producers. On the other hand, the phylogenetic analysis cannot support the commonly assumed phylogenetic relationships between erm and ksgA genes, the common ancestry of erm and ksgA or erm descended from preexisting ksgA, because the tree cannot be unequivocally rooted due to insufficient signal and long-branch attraction. The phylogenetic tree indicates that the erm gene underwent frequent horizontal gene transfer and duplication, resulting in phylogenetic anomalies and atypical phenotypes. Several electronically annotated Erm sequences were recognized as candidates for new classes of macrolide-lincosamide-streptogramin B-resistance determinants, sharing less than an 80% amino acid sequence identity with other Erm classes.