Human behavior is mostly composed of habitual actions that require little conscious control. Such actions may become invalid if the environment changes, at which point individuals need to switch behavior by overcoming habitual actions that are otherwise triggered automatically. It is unknown how the brain controls this type of behavioral switching. Here we show that the presupplementary motor area (pre-SMA) in the medial frontal cortex has a function in switching from automatic to volitionally controlled action in rhesus macaque monkeys. We found that a group of pre-SMA neurons was selectively activated when subjects successfully switched to a controlled alternative action. Electrical stimulation in the pre-SMA replaced automatic incorrect responses with slower correct responses. A further test suggested that the pre-SMA enabled switching by first suppressing an automatic unwanted action and then boosting a controlled desired action. Our data suggest that the pre-SMA resolves response conflict so that the desired action can be selected.