The goal of this study was to evaluate the effects of ketamine and magnesium on prevention of development of morphine tolerance and dependence in mice. In this study different groups of mice received morphine (50 mg/kg, sc) + (saline 10ml/kg), morphine (50 mg/kg, sc) + ketamine (25,50 or 75mg/kg, ip), morphine (50 mg/kg, sc) + magnesium (10,20 or 40 mg/kg, ip), morphine (50 mg/kg, sc) +ketamine (25 mg/kg, ip) + magnesium (10 mg/kg, ip)] once a day for four days. Tolerance was assessed by administration of morphine (9 mg/kg, ip) and using hot plate test on fifth day. Withdrawal symptoms were assessed by administration of naloxone (4 mg/kg, ip) two hours after co-administration of morphine with either ketamine or magnesium. It was found that pretreatment with ketamine or magnesium decreased the degree of tolerance and dependence. Additionally, co-administration of ketamine and magnesium before morphine administration decreased the tolerance and dependence significantly. From these results it may be concluded that administration of ketamine or magnesium alone or together could prevent the development of tolerance and dependence to the analgesic effects of morphine. These effects may be related to the N-Methyl-D-Aspartate (NMDA) receptor antagonist behavior of ketamine and the ability of magnesium to block the Ca channel of NMDA receptors.