Histone variants have been proposed to act as determinants for posttranslational modifications with widespread regulatory functions. We identify a histone-modifying enzyme that selectively methylates the replication-dependent histone H3 variant H3.1. The crystal structure of the SET domain of the histone H3 lysine-27 (H3K27) methyltransferase ARABIDOPSIS TRITHORAX-RELATED PROTEIN 5 (ATXR5) in complex with a H3.1 peptide shows that ATXR5 contains a bipartite catalytic domain that specifically "reads" alanine-31 of H3.1. Variation at position 31 between H3.1 and replication-independent H3.3 is conserved in plants and animals, and threonine-31 in H3.3 is responsible for inhibiting the activity of ATXR5 and its paralog, ATXR6. Our results suggest a simple model for the mitotic inheritance of the heterochromatic mark H3K27me1 and the protection of H3.3-enriched genes against heterochromatization during DNA replication.