Haploinsufficiency of the SHANK3 gene is causally linked to autism spectrum disorder (ASD), and ASD-associated genes are also enriched for chromatin remodelers. Here we found that brief treatment with romidepsin, a highly potent class I histone deacetylase (HDAC) inhibitor, alleviated social deficits in Shank3-deficient mice, which persisted for ~3 weeks. HDAC2 transcription was upregulated in these mice, and knockdown of HDAC2 in prefrontal cortex also rescued their social deficits. Nuclear localization of β-catenin, a Shank3-binding protein that regulates cell adhesion and transcription, was increased in Shank3-deficient mice, which induced HDAC2 upregulation and social deficits. At the downstream molecular level, romidepsin treatment elevated the expression and histone acetylation of Grin2a and actin-regulatory genes and restored NMDA-receptor function and actin filaments in Shank3-deficient mice. Taken together, these findings highlight an epigenetic mechanism underlying social deficits linked to Shank3 deficiency, which may suggest potential therapeutic strategies for ASD patients bearing SHANK3 mutations. Qin et al show that autism-like social deficits in Shank3-deficient mice arise from β-catenin-mediated transcriptional upregulation of histone deacetylase 2 (HDAC2) and are persistently alleviated by brief treatment with HDAC inhibitor romidepsin.