Postoperative cognitive decline is a major clinical problem with high morbidity and mortality after surgery. Many studies have found that molecular hydrogen (H2) has significant neuroprotection against acute and chronic neurological injury by regulating inflammation and apoptosis. In this study, we hypothesized that H2 treatment could ameliorate the development of cognitive impairment following surgery. Adult male rats were subjected to stabilized tibial fracture operation under anesthesia. Two percent of H2 was inhaled for 3 h beginning at 1 h after surgery. Separate cohorts of rats were tested for cognitive function with fear conditioning and the Y-maze test, or euthanized to assess blood–brain barrier integrity, and systemic and hippocampal proinflammatory cytokine and caspase-3 activity. Surgery-challenged animals showed significant cognitive impairment evidenced by a decreased percentage of freezing time and an increased number of learning trials on days 1, 3, and 7 after operation, which were significantly improved by H2 treatment. Furthermore, H2 treatment significantly ameliorated the increase in serum and hippocampal proinflammatory cytokines tumor necrosis factor-α, interleukin-1β, interleukin-6, and high-mobility group protein 1 in surgery-challenged animals. Moreover, H2 treatment markedly improved blood–brain barrier integrity and reduced caspase-3 activity in the hippocampus of surgery-challenged animals. These findings suggest that H2 treatment could significantly mitigate surgery-induced cognitive impairment by regulating inflammation and apoptosis.