DIM-5 is a SUV39-type histone H3 Lys9 methyltransferase that is essential for DNA methylation in N. crassa. We report the structure of a ternary complex including DIM-5, S-adenosyl-L-homocysteine, and a substrate H3 peptide. The histone tail inserts as a parallel strand between two DIM-5 strands, completing a hybrid sheet. Three post-SET cysteines coordinate a zinc atom together with Cys242 from the SET signature motif (NHXCXPN) near the active site. Consequently, a narrow channel is formed to accommodate the target Lys9 side chain. The sulfur atom of S-adenosyl-L-homocysteine, where the transferable methyl group is to be attached in S-adenosyl-L-methionine, lies at the opposite end of the channel, approximately 4 A away from the target Lys9 nitrogen. Structural comparison of the active sites of DIM-5, an H3 Lys9 trimethyltransferase, and SET7/9, an H3 Lys4 monomethyltransferase, allowed us to design substitutions in both enzymes that profoundly alter their product specificities without affecting their catalytic activities.