Microglia, the innate immune cells of the central nervous system, actively participate in brain development by supporting neuronal maturation and refining synaptic connections. These cells are emerging as highly metabolically flexible, able to oxidize different energetic substrates to meet their energy demand. Lactate is particularly abundant in the brain, but whether microglia use it as a metabolic fuel has been poorly explored. Here we show that microglia can import lactate, and this is coupled with increased lysosomal acidification. In vitro, loss of the monocarboxylate transporter MCT4 in microglia prevents lactate-induced lysosomal modulation and leads to defective cargo degradation. Microglial depletion of MCT4 in vivo leads to impaired synaptic pruning, associated with increased excitation in hippocampal neurons, enhanced AMPA/GABA ratio, vulnerability to seizures and anxiety-like phenotype. Overall, these findings show that selective disruption of the MCT4 transporter in microglia is sufficient to alter synapse refinement and to induce defects in mouse brain development and adult behavior.