Coping with the demands of pain diminishes self-regulatory capacity and causes self-regulatory fatigue, which then leads to deteriorated executive task performance. It has been suggested that optimism can counteract the depletion of self-regulatory capacity. This study employed a 2 (optimism/no optimism)×2 (pain/no pain) between-subjects design to explore whether (1) experimentally induced pain (cold pressor task) deteriorates subsequent executive task performance, and (2) whether an optimism induction can counteract this sustained deteriorating effect of pain on executive task performance. Results indicated that although pain led to significantly worse performance on the executive functioning task in the no optimism condition, this sustained deteriorating effect of pain on task performance was abolished in the optimism condition. This finding is imperative because it suggests that optimism may be an important factor to implement in current psychological treatment approaches to diminish the negative impact of chronic pain on the ability to function in daily life.