Fetal brain development is programmed by the maternal intrauterine environment, and disturbance of the in utero environment leads to persisting deficits in brain functions of the offspring. Testosterone is an intrauterine environmental factor, and plays significant roles in fetal development. From human and animal model studies, it has been suggested that increased intrauterine testosterone concentration triggers subsequent autistic-like behavior of the offspring; however, the effects of maternal excess testosterone on synaptic development of the offspring remain unknown. In the present study, we employed prenatally testosterone-exposed mice, and by using in vivo two-photon imaging, we analyzed the dynamics, density, and morphology of the dendritic spine, an excitatory postsynaptic structure. We found that the offspring from testosterone-treated dams showed abnormal synaptic instability persisting into young adulthood, whereas dendritic spines in control mice became stabilized with normal synaptic maturation. In prenatally testosterone-exposed mice, the density of dendritic spines was excessively increased, and their morphology was abnormal. These results suggest that prenatally testosterone-exposed mice may have deficits in synaptic development, and furthermore that the observed pathological features of their dendritic spines may be the cause of the synaptic pathogenesis in prenatally testosterone-exposed mice.