Previously, we had shown that donepezil provides anti-apoptotic effects associated with the prevention of morphine tolerance to the analgesic effect. In this regard, the present study aimed to evaluate the molecular mechanisms involved in this effect considering the possible role of Toll-like receptor (TLR) 2,4, and the balance between pre-apoptotic and anti-apoptotic Bcl family proteins. To this end, male Wistar rats received daily morphine in combination with either normal saline or donepezil (0.5, 1, or 1.5 mg/kg, ip). The analgesic effect was assessed by the plantar test apparatus. The latency was recorded when the animal responded to the light stimulus. On the 15th day, when no significant difference was observed between morphine and saline groups in terms of analgesia, the frontal cortex and lumbar spinal cord of the animals were dissected. Then, TLR2 and 4, Bcl2, and Bax mRNA fold changes were calculated using Real-time PCR method. The results indicated no significant analgesic effect in the morphine group compared with the saline treated animals after 15 days of injection, while daily co-administration of donepezil with morphine preserved significant analgesia. Moreover, Quantitative PCR showed that morphine significantly increased TLRs and Bax gene expressions and decreased the anti-apoptotic Bcl2. In contrast, donepezil prevented these morphine induced changes in the mentioned gene expressions. Taken together, the results suggest that the neuroprotective effects of donepezil in attenuating morphine-induced tolerance and apoptosis are mediated by preventing morphine-induced changes in TLR2 and 4 gene expressions.