Propofol is widely used in clinical practice, including non‐obstetric surgery in pregnant women. Previously, we found that propofol anaesthesia in maternal rats during the third trimester (E18) caused learning and memory impairment to the offspring rats, but how about the exposure during early pregnancy and the underlying mechanisms? Histone acetylation plays an important role in synaptic plasticity. In this study, propofol was administered to the pregnant rats in the early pregnancy (E7). The learning and memory function of the offspring were tested by Morris water maze (MWM) test on post‐natal day 30. Two hours before each MWM trial, histone deacetylase 2 (HDAC2) inhibitor, suberoylanilide hydroxamic acid (SAHA), Senegenin (SEN, traditional Chinese medicine), hippyragranin (HGN) antisense oligonucleotide (HGNA) or vehicle were given to the offspring. The protein levels of HDAC2, acetylated histone 3 (H3) and 4 (H4), cyclic adenosine monophosphate (cAMP) response element‐binding protein (CREB), N‐methyl‐D‐aspartate receptor (NMDAR) 2 subunit B (NR2B), HGN and synaptophysin in offspring's hippocampus were determined by Western blot or immunofluorescence test. It was discovered that infusion with propofol in maternal rats on E7 leads to impairment of learning and memory in offspring, increased the protein levels of HDAC2 and HGN, decreased the levels of acetylated H3 and H4 and phosphorylated CREB, NR2B and synaptophysin. HDAC2 inhibitor SAHA, Senegenin or HGN antisense oligonucleotide reversed all the changes. Thus, present results indicate exposure to propofol during the early gestation impairs offspring's learning and memory via inhibiting histone acetylation. SAHA, Senegenin and HGN antisense oligonucleotide might have therapeutic value for the adverse effect of propofol.