It is widely assumed that distraction reduces pain. Similarly, it is assumed that pain distracts from concurrent, unrelated cognitive processing, reducing performance on difficult tasks. Taken together, these assumptions suggest pain processing and cognitive function engage an overlapping set of domain-general, capacity-limited mental resources. However, experimental tests of this proposal have yielded mixed results, leading to alternative proposals that challenge the common model of a bidirectional relationship between concurrent pain and task performance. We tested these contrasting positions using a novel concurrent pain and executive working memory paradigm. Both task difficulty and nociceptive stimulus intensity were individually calibrated for each participant. Participants reported less pain during the working memory task than a visually matched control condition. Conversely, increasing levels of heat incrementally reduced task performance. Path analyses showed that variations in pain completely mediated this effect, and that even within a given heat level, trial-by-trial fluctuations in pain predicted decrements in performance. In sum, these findings argue that overlapping cognitive resources play a role in both pain processing and executive working memory. Future studies could use this paradigm to understand more precisely which components of executive function or other cognitive resources contribute to the experience of pain.