Cytosine methylation promotes deamination. In eukaryotes, CpG methylation is thought to account for CpG underrepresentation. Whether scarcity of CpGs in prokaryotic genomes is diagnostic for methylation is not clear. Here, we report that Mycoplasms tend to be CpG depleted and to harbor a family of constitutively expressed or phase variable CpG-specific DNA methyltransferases. The very CpG poor Mycoplasma penetrans and its constitutively active CpG-specific methyltransferase M.MpeI were chosen for further characterization. Genome-wide sequencing of bisulfite-converted DNA indicated that M.MpeI methylated CpG target sites both in vivo and in vitro in a locus-nonselective manner. A crystal structure of M.MpeI with DNA at 2.15-Å resolution showed that the substrate base was flipped and that its place in the DNA stack was taken by a glutamine residue. A phenylalanine residue was intercalated into the "weak" CpG step of the nonsubstrate strand, indicating mechanistic similarities in the recognition of the short CpG target sequence by prokaryotic and eukaryotic DNA methyltransferases.