Debate continues about the effect of 3, 4-methylenedioxymethamphetamine (MDMA) on cognitive and mitochondrial function through the CNS. It has been shown that physical exercise has an important protective effect on cellular damage and death. Therefore, we investigated the effect of physical exercise on MDMA-induced impairments of spatial learning and memory as well as MDMA effects on brain mitochondrial function in rats. Male wistar rats underwent short-term (2 weeks) or long-term (4 weeks) treadmill exercise. After completion of exercise duration, acquisition and retention of spatial memory were evaluated by Morris water maze (MWM) test. Rats were intraperitoneally (I.P) injected with MDMA (5, 10, and 15 mg/kg) 30 min before the first training trial in 4 training days of MWM. Different parameters of brain mitochondrial function were measured including the level of ROS production, mitochondrial membrane potential (MMP), mitochondrial swelling, mitochondrial outermembrane damage, the amount of cytochrome c release from the mitochondria, and ADP/ATP ratio. MDMA damaged the spatial learning and memory in a dose-dependent manner. Brain mitochondria isolated from the rats treated with MDMA showed significant increase in ROS formation, collapse of MMP, mitochondrial swelling, and outer membrane damage, cytochrome c release from the mitochondria, and finally increased ADP/ATP ratio. This study also found that physical exercise significantly decreased the MDMA-induced impairments of spatial learning and memory and also mitochondrial dysfunction. The results indicated that MDMA-induced neurotoxicity leads to brain mitochondrial dysfunction and subsequent oxidative stress is followed by cognitive impairments. However, physical exercise could reduce these deleterious effects of MDMA through protective effects on brain mitochondrial function.