Obstructive sleep apnea (OSA), a state of sleep disruption, is characterized by recurrent apnea, chronic intermittent hypoxia (CIH) and hypercapnia. Previous studies have showed that CIH-induced neuroinflammatory plays a crucial role in cognitive deficits. Pseudoginsenoside GQ (PGQ) is a new oxytetracycline-type saponin formed by the oxidation and cyclization of the 20(S) Rg3 side chain. Rg3 has been found to afford anti-inflammatory effects, while whether PGQ plays a role of anti-neuroinflammatory remains unclear. The purpose of this study was to investigate whether PGQ attenuates CIH-induced neuroinflammatory and cognitive impairment and the possible mechanism it involves. We found that PGQ significantly ameliorated CIH-induced spatial learning deficits, and inhibited microglial activation, pro-inflammatory cytokine release, and neuronal apoptosis in the hippocampus of CIH mice. In addition, PGQ pretreatment promoted microglial M1 to M2 phenotypic transition in IH-induced BV-2 microglial, as well as indirectly inhibited IH-induced neuronal injury via modulation of microglia polarization. Furthermore, we noted that activation of HMGB1/TLR4/NF-κB signaling pathway induced by IH was inhibited by PGQ. Molecular docking results revealed that PGQ could bind to the active sites of HMGB1 and TLR4. Taken together, this work supports that PGQ inhibits M1 microglial polarization via the HMGB1/TLR4/NF-κB signaling pathway, and indirectly exerts neuroprotective effects, suggesting that PGQ may be a potential therapeutic strategy for cognitive impairment accompanied OSA.