Many of the genes disrupted in autism are identified as histone-modifying enzymes and chromatin remodelers, most prominently those that mediate histone methylation/demethylation. However, the role of histone methylation enzymes in the pathophysiology and treatment of autism remains unknown. To address this, we used mouse models of haploinsufficiency of the Shank3 gene (a highly penetrant monogenic autism risk factor), which exhibits prominent autism-like social deficits. We found that histone methyltransferases EHMT1 and EHMT2, as well as histone lysine 9 dimethylation (specifically catalyzed by EHMT1/2), were selectively increased in the prefrontal cortex (PFC) of Shank3-deficient mice and autistic human postmortem brains. Treatment with the EHMT1/2 inhibitor UNC0642 or knockdown of EHMT1/2 in PFC induced a robust rescue of autism-like social deficits in Shank3-deficient mice, and restored NMDAR-mediated synaptic function. Activity-regulated cytoskeleton-associated protein (Arc) was identified as one of the causal factors underlying the rescuing effects of UNC0642 on NMDAR function and social behaviors in Shank3-deficient mice. UNC0642 treatment also restored a large set of genes involved in neural signaling in PFC of Shank3-deficient mice. These results suggest that targeting histone methylation enzymes to adjust gene expression and ameliorate synaptic defects could be a potential therapeutic strategy for autism.