One of the most important survival mechanisms is learning and memory processes. To emphasize the role of physical exercises and magnesium (Mg) in improvement of cognitive performance, we planned to investigate the effect of Mg and mild compulsive exercise on spatial learning and memory of adult male rats. Accordingly, we divided male Wistar rats into four groups: (I) control, (II) Mg treatment, (III) exercise, and (IV) Mg-exercise in the different dosages of Mg (0.5, 1, 1.5, and 2 mmol/kbw) were injected in the form of gavage during 1 week. Also, 1-week mild running on treadmill was used for exercise treatment. The Morris water maze (MWM) test and open field tool were used to evaluate spatial learning, memory, and motor activity, respectively. Our results clearly showed that 1 mmol/kbw Mg was applied as an effective dosage. Strikingly, 1-week mild exercise on treadmill had no significant effect on spatial motor activity, learning, and memory. Feeding 1 mmol/kbw Mg for a week showed a significant difference in learning and exploration stages. Compared to control animals, these results reveal exercise and Mg simultaneously had effect on learning and reminding. As a consequence, although mild exercise had no effect on motor activity and memory, Mg intake improved spatial learning, memory, and locomotor activity. The Mg feeding could be a promising supplemental treatment in the neurodegenerative disease. It is worthwhile to mention consumption of Mg leads to enhancement of memory, so animals find the hidden platform with the highest velocity.