The process of methylation was first described in bacteria in 1948. Most bacterial strains contain enzymes called restriction endonucleases. These restriction enzymes recognize certain short sequences of DNA, and cleave the DNA strand at these sites. By modifying its DNA with a pattern of methylation specific to its strain, a bacterium can use this system of modification and restriction to distinguish its own DNA from invading foreign DNA. Methylation serves to protect the bacterial DNA from digestion by its own restriction enzymes.
In mammals, methylation has also been proposed to be a genome defense system against foreign DNA such as viruses. Viruses that infect cells and integrate into the host cell DNA frequently become methylated. While methylation in eukaryotes does not mark DNA for digestion, methylation can inactivate a promoter and thereby silence gene expression from a viral promoter. Evidence in support of this comes from the fact that most methylated cytosines in the mammalian genome lie within viral and transposon DNA. In addition to silencing gene expression from foreign DNA promoters, methylation has also been shown to prevent DNA sequences such as transposons from moving to a new site in the DNA. In this way, methylation can limit the spread of infectious virus from cell to cell, and prevent the damaging spread of transposon sequences.