Cognitive impairments induced by severe acute pancreatitis (SAP) are severe complications, for which there are a lack of effective pharmacological treatment strategies. Berberine is an isoquinoline alkaloid extracted from the Chinese herb, Coptis rhizome, which exhibits numerous biological effects on gastrointestinal disorders. However, the effects of berberine on SAP‑induced cognitive impairments remain unknown. The present study aimed to investigate the effects of berberine on cognitive impairments associated with SAP. Wistar rats were randomly divided into Sham, Sham + berberine, SAP and SAP + berberine groups. Rats were intraperitoneally injected with L‑arginine (3 g/kg) to induce SAP. Subsequently, selected rats were intragastrically administered berberine (100 mg/kg) once daily for 6 consecutive days. Disease severities of rats were investigated 48 h post‑induction of SAP via determination of serum amylase levels and hematoxylin and eosin staining. Survival rates, performance of behavioral tests (automated rotarod and fear conditioning tests), blood brain barrier (BBB) permeability, and the expression levels of tumor necrosis factor (TNF)‑α and interleukin (IL)‑1β in hippocampal tissues were also determined. Proteins associated with apoptosis and necroptosis in the hippocampal tissues of SAP rats, including caspase‑3, receptor‑interacting protein kinase (RIP)1 and RIP3, were detected via western blotting. The results revealed that treatment with L‑arginine induced SAP, which subsequently resulted in increased BBB permeability, mortality rates and cognitive deficits in rats. The expression levels of TNF‑α, IL‑1β, caspase‑3, RIP1 and RIP3 were significantly increased in the hippocampal tissues of SAP rats, thus suggesting that neuroinflammation, apoptosis and necroptosis may be involved in neurodegeneration associated with the development of SAP. Notably, administration of berberine protected the integrity of the BBB, decreased levels of brain inflammation and mortality rates, and attenuated increased levels of proteins associated with apoptosis and necroptosis and cognitive deficits associated with SAP in rats. The results of the present study demonstrated that daily treatment with berberine may attenuate cognitive deficits and reduce associated mortality via exhibition of anti‑neuroinflammatory effects and attenuation of neuronal apoptosis and necroptosis in the hippocampal tissues of SAP rats.