The epigenetic modification of chromatin structure and its effect on complex neuronal processes like learning and memory is an emerging field in neuroscience. However, little is known about the "writers" of the neuronal epigenome and how they lay down the basis for proper cognition. Here, we have dissected the neuronal function of the Drosophila euchromatin histone methyltransferase (EHMT), a member of a conserved protein family that methylates histone 3 at lysine 9 (H3K9). EHMT is widely expressed in the nervous system and other tissues, yet EHMT mutant flies are viable. Neurodevelopmental and behavioral analyses identified EHMT as a regulator of peripheral dendrite development, larval locomotor behavior, non-associative learning, and courtship memory. The requirement for EHMT in memory was mapped to 7B-Gal4 positive cells, which are, in adult brains, predominantly mushroom body neurons. Moreover, memory was restored by EHMT re-expression during adulthood, indicating that cognitive defects are reversible in EHMT mutants. To uncover the underlying molecular mechanisms, we generated genome-wide H3K9 dimethylation profiles by ChIP-seq. Loss of H3K9 dimethylation in EHMT mutants occurs at 5% of the euchromatic genome and is enriched at the 5' and 3' ends of distinct classes of genes that control neuronal and behavioral processes that are corrupted in EHMT mutants. Our study identifies Drosophila EHMT as a key regulator of cognition that orchestrates an epigenetic program featuring classic learning and memory genes. Our findings are relevant to the pathophysiological mechanisms underlying Kleefstra Syndrome, a severe form of intellectual disability caused by mutations in human EHMT1, and have potential therapeutic implications. Our work thus provides novel insights into the epigenetic control of cognition in health and disease.