Microglia are the main immune component in the brain that can regulate neuronal health and synapse function. Exposure to cosmic radiation can cause long-term cognitive impairments in rodent models thereby presenting potential obstacles for astronauts engaged in deep space travel. The mechanism/s for how cosmic radiation induces cognitive deficits are currently unknown. We find that temporary microglia depletion, one week after cosmic radiation, prevents the development of long-term memory deficits. Gene array profiling reveals that acute microglia depletion alters the late neuroinflammatory response to cosmic radiation. The repopulated microglia present a modified functional phenotype with reduced expression of scavenger receptors, lysosome membrane protein and complement receptor, all shown to be involved in microglia-synapses interaction. The lower phagocytic activity observed in the repopulated microglia is paralleled by improved synaptic protein expression. Our data provide mechanistic evidence for the role of microglia in the development of cognitive deficits after cosmic radiation exposure.