Morphine abuse in treating severe and chronic pain has become a worldwide problem. But, chronic morphine exposure can cause memory impairment with its mechanisms not fully elucidated by past research sstudies which all focused on the harmful effects of morphine. Autophagy is an important pathway for cells to maintain survival. Here we showed that repeated morphine injection into C57BL/6 mice at a dose of 15?mg/kg per day for 7?days activated autophagic flux mainly in the hippocampi, especially in neurons of hippocampal CA1 region and microglia, with spatial memory impairment confirmed by Morris water maze test. Autophagy inhibition by 3-methyladenine obviously aggravates this morphine-induced memory impairment, accompanied with increased cell deaths in stratum pyramidale of hippocampal CA1, CA3, and DG regions and the activation of microglia to induce inflammation in hippocampus, such as upregulated expression of TNF-α, IL-1β, IL-6, and iNOS, as well as NF-κB' s activation, while morphine alone promoted microglial immunosuppression in hippocampus with autophagy activation which was also confirmed in primary microglia. Taken together, our data indicates that autophagy activating in hippocampal cells can alleviate the memory impairment caused by morphine, by decreasing neuronal deaths in hippocampus and suppressing inflammation in hippocampal microglia, implying that modulating the activation of autophagy might be a promising method to prevent or treat the memory impairment caused by morphine.