In mammals, DNA is methylated at cytosines within CpG dinucleotides. Properly regulated methylation is crucial for normal development. Inappropriate methylation may contribute to tumorigenesis by silencing tumor-suppressor genes or by activating growth-stimulating genes. Although many genes have been identified that acquire methylation and whose expression is methylation-sensitive, little is known about how DNA methylation is controlled. We have identified a DNA sequence that regulates establishment of DNA methylation in the male germ line at Rasgrf1. In mice, the imprinted Rasgrf1 locus is methylated on the paternal allele within a differentially methylated domain (DMD) 30 kbp 5' of the promoter. Expression is exclusively from the paternal allele in neonatal brain. Methylation is regulated by a repeated sequence, consisting of a 41-mer repeated 40 times, found immediately 3' of the DMD. This sequence is present in organisms in which Rasgrf1 is imprinted. In addition, DMD methylation is required for imprinted Rasgrf1 expression. Together the DMD and repeat element constitute a binary switch that regulates imprinting at the locus.