Microglia are phagocytic cells that infiltrate the brain during development and have a role in the elimination of synapses during brain maturation. Changes in microglial morphology and gene expression have been associated with neurodevelopmental disorders. However, it remains unknown whether these changes are a primary cause or a secondary consequence of neuronal deficits. Here we tested whether a primary deficit in microglia was sufficient to induce some autism-related behavioral and functional connectivity deficits. Mice lacking the chemokine receptor Cx3cr1 exhibit a transient reduction of microglia during the early postnatal period and a consequent deficit in synaptic pruning. We show that deficient synaptic pruning is associated with weak synaptic transmission, decreased functional brain connectivity, deficits in social interaction and increased repetitive-behavior phenotypes that have been previously associated with autism and other neurodevelopmental and neuropsychiatric disorders. These findings open the possibility that disruptions in microglia-mediated synaptic pruning could contribute to neurodevelopmental and neuropsychiatric disorders.