ABSTRACT This study was designed to explore the effects of esketamine on cognitive deficits and blood–brain barrier (BBB) dysfunction in sepsis‐associated encephalopathy (SAE). An in vivo SAE model was generated through the administration of lipopolysaccharide (LPS), and LPS‐induced cognitive impairment in rats was evaluated using the Morris water maze (MWM) test. BBB disruption in vivo was assessed by measuring brain water content together with Evans blue dye penetration, while LPS‐induced endothelial hyperpermeability in vitro was examined through FITC–dextran leakage. The protein expression of claudin‐3 and ZO‐1 was determined by western blotting. In addition, the levels of pro‐inflammatory cytokines, cell apoptosis, autophagy, and the activity of the BDNF/TrkB pathway were examined. Rapamycin (Rap, an autophagy inducer) and K252a (a BDNF inhibitor) were used to determine whether the protective effects of esketamine were associated with autophagy and BDNF/TrkB signaling. Esketamine treatment significantly improved the LPS‐induced cognitive dysfunction and neurological injury observed in vivo, and it also inhibited the production of pro‐inflammatory cytokines and reduced cell apoptosis both in vivo and in LPS‐treated hCMEC/D3 cells. Importantly, esketamine alleviated BBB hyperpermeability in vivo and prevented LPS‐induced endothelial leakage in vitro. Moreover, esketamine suppressed LPS‐induced autophagy, and the influence of esketamine on claudin‐3 and ZO‐1 expression was reversed when Rap was applied. Esketamine activated the BDNF/TrkB pathway, and the protective effects of esketamine on BBB integrity and autophagy in response to LPS were abolished by K252a. Taken together, these findings indicate that esketamine protects the BBB against SAE by activating the BDNF/TrkB pathway and inhibiting autophagy, providing a potential therapeutic strategy for SAE.