We aimed to explore the impact of the cerebellum on the decline in spatial working memory after morphine dependence and withdrawal. Two groups of male Wistar rats received intraperitoneal injections of either saline (1 ml/kg) or morphine (10 mg/kg) twice daily for 10 days, serving as the control and dependent groups. Additionally, a withdrawal group underwent a 30-day withdrawal period after the dependence phase. Spatial working memory was assessed using a Y maze test. ELISA and western blot were used to assess protein levels in the cerebellum. On day 1, morphine impaired spatial working memory, deteriorated further after 10 days of morphine use, and nearly returned to its initial level following a 30-day withdrawal period. On day 10, significant increases in TNF-α, IL-1β, and CXCL12 and a notable decrease in IL-10 levels were detected in the morphine-dependent group, which did not completely restore in the withdrawal group. The protein levels of CXCR4, TLR4, P2X7R, and NF-κB sharply increased in the morphine-dependent group. However, these levels almost returned to normal after withdrawal. In the morphine-dependent group, BDNF decreased, while TrkB and CREB1 increased noticeably. Nevertheless, after withdrawal, TrkB and CREB1 but not BDNF levels returned to normal. In the morphine-dependent group, both CACNA1 and KCNMA1 decreased significantly and after withdrawal, only KCNMA1 showed partial restoration, while CACNA1 did not. It can be concluded that inflammation/NF-κB and BDNF/TrkB/CREB pathways play key roles in neural adaptation within the cerebellum, contributing to the decline in spatial working memory after both morphine dependence and withdrawal.