Deep brain stimulation (DBS) of the subthalamic nucleus (STN) or the internal segment of the globus pallidus (GPi) improves Parkinson's disease and increases frontal blood flow. We assessed the effects of bilateral DBS on executive function in Parkinson's disease patients, seven with electrodes implanted in the STN and six in the GPi. Patients were assessed off medication with stimulators off, on and off again. The groups showed differential change with stimulation on the Reitan Trail-Making test (TMT B) (STN more improved) and on some measures of random number generation and Wisconsin Card Sorting (STN improved, GPi worse with stimulation). Across the groups, stimulation speeded up responding (Stroop control trial, TMT A) and improved performance on paced serial addition and missing digit tests. Conversely, conditional associative learning became more errorful with stimulation across the two groups. In general, change in performance with stimulation was significant for the STN but not the GPi group. These results support two opposite predictions. In support of current models of Parkinson's disease, 'releasing the brake' on frontal function with DBS improved aspects of executive function. Conversely, disruption of basal ganglia outflow during DBS impaired performance on tests requiring changing behaviour in novel contexts as predicted by Marsden and Obeso in 1994.