Epigenetic regulation of gene expression plays critical roles in maintaining genome integrity, imprinting, cellular differentiation and development as well as in responding versatile environmental signals. Two longstanding and fundamental questions in the field of plant epigenetics are how certain DNAs are targeted by methylation and how DNA methylation is stably and faithfully maintained. Through a combination of genetic, genomic, cellular, biochemical and structural approaches, we discovered dual binding of chromomethylase to H3K9me2-containing nucleosomes as a novel means of precisely directing methylation to certain DNA sequences. Furthermore, we uncovered a novel role of DNA methylation in targeting the promoters of many protein-coding genes, providing crucial mechanistic insights into DNA methylation. Findings from these studies have broad implications for our understanding of how distinct chromatin modifications regulate gene expression for normal growth and development, and for responses to biotic and abiotic stresses.