Impaired glucose metabolism reflects neuronal/synaptic dysfunction and cognitive function decline in patients with obstructive sleep apnea (OSA). The study investigated the extent to which exercise training (ET) improves cerebral metabolic glucose rate (CMRgl) and cognitive function in patients with OSA. Patients with moderate to severe OSA were randomly assigned to ET (3 times/week, n = 23) or no intervention (control, n = 24). Echocardiography and apolipoprotein ε4 (APOEε4) genotyping were obtained at baseline. Both groups underwent cardiopulmonary exercise testing, polysomnography, cognitive tests, brain magnetic resonance imaging, and 18F-fluoro-2-deoxy-d-Glucose positron emission tomography (18FDG-PET) at baseline and study end. Compared with control, exercise-trained group had improved exercise capacity, decreased apnea–hypopnea index (AHI), oxygen desaturation and arousal index; increased attention/executive functioning, increased CMRgl in the right frontal lobe (P < 0.05). After ET an inverse relationships occurred between CMRgl and obstructive AHI (r = − 0.43, P < 0.05) and apnea arousal index (r = − 0.53, P < 0.05), and between the changes in CMRgl and changes in mean O2 saturation during sleep and non-rapid eye movement sleep (r = − 0.43, P < 0.05), desaturation during arousal (r = − 0.44, P < 0.05), and time to attention function testing (r = − 0.46, P < 0.05). ET improves OSA severity and CMRg in the frontal lobe, which helps explain the improvement in attention/executive functioning. Our study provides promising data that reinforce the growing idea that ET may be a valuable tool to prevent hypoxia associated with decreased brain metabolism and cognitive functioning in patients with moderate to severe OSA.Trial registration: NCT02289625 (13/11/2014).