Humans carry out many daily tasks in a seemingly automatic fashion. However, when unexpected changes in the environment occur, we have the capacity to inhibit prepotent behavior and replace it with an alternative one. Such behavioral flexibility is a hallmark of executive functions. The neurotransmitter dopamine is known to be crucial for fast, efficient, and accurate cognitive flexibility. Despite the perceived similarities between cognitive and motor flexibility, less is known regarding the role of dopamine within the motor domain. Therefore, the aim of this study was to determine the role of dopamine in motor flexibility. In a double-blind, five-session, within-subject pharmacological experiment, human participants performed an RT task within a probabilistic context that was either predictable or unpredictable. The probabilistic nature of the predictable context resulted in prediction errors. This required participants to replace the prepotent or prepared action with an unprepared action (motor flexibility). The task was overlearned, and changes in context were explicitly instructed, thus controlling for contributions from other dopamine-related processes such as probabilistic or reversal learning and interactions with other types of uncertainty. We found that dopamine receptor blockade by high-dose haloperidol (D1/D2 dopamine receptors) impaired participants' ability to react to unexpected events occurring in a predictable context, which elicit large prediction errors and necessitate motor flexibility. This effect was not observed with selective D2 receptor blockade (sulpiride), with a general increase in tonic dopamine levels (levodopa), or during an unpredictable context, which evoked minimal prediction error. We propose that dopamine is vital in responding to low-level prediction errors about stimulus outcome that requires motor flexibility.