Background Sleep disorder-associated cognitive impairments are often accompanied by impaired synaptic plasticity. In the pathological process of sleep deprivation, microglia, as an important innate immune cell in central nervous system, are involved and mediate the synaptic pruning, in which the CX3C-chemokine receptor 1 receptor (CX3CR1) plays an indispensable role. In this study, the potential role of CX3CR1 in modulating the cognition decline during sleep deprivation was evaluated in terms of microglial neuroinflammation and synaptic pruning. Methods Middle-aged wild type C57BL/6 mice (WT) (13 months) and age-matched CX3CR1 -/- mice were either subjected to sleep deprivation (SD) or allowed normal sleep (S) for 8 h to mimic the pathophysiological changes of middle-aged people after staying up all night in real life. The hippocampus-dependent cognition was assessed by fear conditioning test. Mice brains were extracted for neuroinflammation and synaptic pruning studies. Data were analyzed by Student’s t-test and one-way analysis of variance (one-way ANOVA). Results The CX3CR1 deficiency mice differed from WT mice in many measures. CX3CR1 deficiency prevented SD-induced cognitive impairments, in which the levels of brain-derived neurotrophic factor (BDNF) and phosphorylated cAMP-responsive element binding protein (p-CREB) were markedly increased in the hippocampus. Compared with the CX3CR1 -/- -S group, the CX3CR1 -/- -SD mice reported a markedly decreased microglial density in the dentate gyrus, notably-decreased levels of cellular oncogene fos (c-fos), and pro-inflammatory cytokines and increased levels of anti-inflammatory cytokines in the hippocampus, and a significant increase in the density of spines of the dentate gyrus area. Furthermore, the CX3CR1 -/- -SD group also showed a decreasing expression of microglial phagocytosis-related factors. Conclusion These findings suggest that CX3CR1 deficiency leads to different cerebral behaviors and responses to sleep deprivation. CX3CR1 deletion can alleviate the sleep deprivation-induced cognitive impairment. The inflammation-attenuating activity and the related modification of synaptic pruning are possible mechanism candidates, which indicate CX3CR1 as a candidate therapeutic target for the prevention of the sleep loss-induced cognitive impairments.