Despite the worldwide use of tramadol, few studies have been conducted about its effects on memory and mitochondrial function, and controversial results have been reported. Recently, there has been an increasing interest in physical exercise as a protective approach to neuronal and cognitive impairments. Therefore, the aim of this study was to investigate the effects of physical exercise on spatial learning and memory and brain mitochondrial function in tramadol-treated rats. After completion of 2-week (short-term) and 4-week (long-term) treadmill exercise regimens, male Wistar rats received tramadol (20, 40, 80 mg/kg/day) intraperitoneally for 30 days. Then spatial learning and memory was assessed by Morris water maze test (MWM). Moreover, brain mitochondrial function was evaluated by determination of mitochondrial reactive oxygen species (ROS) level, mitochondrial membrane potential (MMP), mitochondrial swelling and cytochrome c release from mitochondria. Chronic administration of tramadol impaired spatial learning and memory as well as brain mitochondrial function as indicated by increased ROS level, MMP collapse, increased mitochondrial swelling and cytochrome c release from mitochondria. Conversely, treadmill exercise significantly attenuated the impairments of spatial learning and memory and brain mitochondrial dysfunction induced by tramadol. The results revealed that chronic tramadol treatment caused memory impairments through induction of brain mitochondrial dysfunction. Furthermore, pre-exposure to physical exercise markedly mitigated these impairments through its positive effects on brain mitochondrial function.