Many diverse factors, ranging from stress to infections, can perturb brain homeostasis and alter the physiological activity of microglia, the immune cells of the central nervous system. Microglia play critical roles in the process of synaptic maturation and brain wiring during development. Any perturbation affecting microglial physiological function during critical developmental periods could result in defective maturation of synaptic circuits. In this review, we critically appraise the recent literature on the alterations of microglial activity induced by environmental and genetic factors occurring at pre- and early post-natal stages. Furthermore, we discuss the long-lasting consequences of early-life microglial perturbation on synaptic function and on vulnerability to neurodevelopmental and psychiatric disorders.