Objective. Cardiopulmonary bypass (CPB) is an important cardiac operation and also a high-risk procedure, leading to postoperative neurocognitive disorder. However, there are few effective drugs to treat the aftermath of CPB. Therefore, we observe the effect of kappa opioid receptor (KOR) agonist on cognitive disorders of rats after cardiopulmonary bypass (CPB) and investigate the mechanism of the Ca2+/calmodulin-dependent protein kinase (CaMKII)/cAMP responsive element-binding protein (CREB) pathway. Methods. A total of 40 Sprague Dawley rats were randomly divided into the sham operation group (sham group, n = 10), CPB model group (CPB group, n = 10), CPB + KOR agonist U50488H group (UH group, n = 10), and CPB + specific CaMKII antagonist + U50488H group (CKU group, n = 10). The changes in the rats’ cognitive function were evaluated using the Morris water maze, the hippocampal histopathological changes were observed via hematoxylin-eosin (H&E) staining, and the apoptosis rate of neuronal cells was detected through terminal deoxynucleotidyl transferase-mediated dUTP nick-end labeling (TUNEL) staining. Moreover, enzyme-linked immunosorbent assay (ELISA) was applied to examine the changes in brain injury markers, inflammatory factors, and oxidative stress factors. The hippocampal variations in Ca2+ concentration and oxidative stress index (ROS) levels were measured by immunofluorescence staining, and western blotting was performed to determine the expression changes in the Ca2+/CaMKII/CREB pathway. Results. The KOR agonist could shorten latency, increase the swimming distance and residence time in the target quadrant, and ameliorate postoperative neurocognitive disorder (PND). Meanwhile, the KOR agonist relieved CPB-induced hippocampal and oxidative stress injuries, reduced NSE and S-100β expression, decreased the apoptosis rate, and repressed the inflammatory response, which alleviated the brain injury. In addition, U50488H was able to decrease Ca2+ influx and glutamate (Glu) level, inhibit N-methyl-D-aspartate receptor (NMDAR) expression, upregulate CaMKII expression, promote CREB phosphorylation, and increase the brain-derived neurotrophic factor (BDNF) level in CPB rats. However, the protective effects of KORs against PND were suppressed following the application of the CaMKII-specific antagonist. Conclusion. The KOR agonist activates the Ca2+/CaMKII/CREB pathway, which improves the brain injury and relieves PND in CPB rats.