Background It is a common phenomenon that children experience multiple general anesthesias in clinical practice, which raises the question whether repeated exposure to general anesthetics would interfere with the development of the central nervous system of children. The present study was designed to evaluate the effects of repeated treatment with ketamine or midazolam on postnatal dendrite development by examining the morphology of the dendritic spines of the pyramidal neurons in the hippocampal CA1 region in mice. Methods The transgenic green fluorescent protein-M line (GFP-M) mice were used in this study. Ketamine (100 mg/kg), midazolam (50 mg/kg) or saline (10 ml/kg) was administered intraperitoneally once a day on consecutive days from postnatal day 8 (P8) to postnatal day 12 (P12). At postnatal day 13 (P13) and postnatal day 30 (P30), the density and length of the apical dendritic spines of the pyramidal neurons in the hippocampal CA1 region were examined under a confocal microscope. Results At P13, for both the ketamine group and the midazolam group, the dendritic spines were found with a comparatively lower density and longer average length than in the control group. At P30, no significant difference in the density or average length of dendritic spines was found between the anesthetic group and control group. Conclusions This study indicated that repeated exposure to ketamine or midazolam in neonatal mice impaired dendritic spine maturation immediately afterwards, but this influence seemed to disappear during further postnatal development.