More than 75% of patients with mild traumatic brain injury (MTBI) report chronic pain whose potential detrimental effects on cognitive recovery need to be identified. The objective of this study was to investigate the relationship between pain, performance on a working memory task, gray matter density, and mid-dorsolateral prefrontal cortex (mid-DLPFC) activation in subjects with a MTBI. For comparison purposes, we performed identical correlation analyses with a group of subjects without MTBI who sustained sports injuries. Twenty-four subjects who experienced a MTBI in the past 12 months, 16 control subjects, and 29 subjects with sport injuries were included. One hour prior to entering the magnetic resonance scanner, the subjects were asked to fill out the pain Visual Analogue Scale. Subsequently, a high-resolution T1-weighted image was acquired followed by a functional magnetic resonance imaging session using the visual externally ordered working memory task. Results showed that MTBI subjects reporting severe pain in the hour preceding the testing had reduced mid-DLPFC activation during the working memory task and poorer performance on the task. Subjects with sport injuries and severe levels of pain showed the reverse pattern: pain was associated with higher activation in the mid-DLPFC and did not correlate with performance. Gray matter density measures were independent of pain level. This study showed that behavioral performance and cerebral functioning are affected by pain after a MTBI. Moreover, this study suggests that pain, cognition, and cerebral functioning interactions could not easily be generalized from one clinical population to another.