Practice makes perfect, but the neural substrates of trial-to-trial learning in motor tasks remain unclear. There is some evidence that the basal ganglia process feedback-related information to modify learning in essentially cognitive tasks , but the evidence that these key motor structures are involved in offline feedback-related improvement of performance in motor tasks is paradoxically limited. Lesion studies in adult zebra finches suggest that the avian basal ganglia are involved in the transmission or production of an error signal during song . However, patients with Huntington's disease, in which there is prominent basal ganglia dysfunction, are not impaired in error-dependent modulation of future trial performance . By directly recording from the subthalamic nucleus in patients with Parkinson's disease, we demonstrate that this nucleus processes error in trial performance at short latency. Local evoked activity is greatest in response to smallest errors and influences the programming of subsequent movements. Accordingly, motor parameters are least likely to change after the greatest evoked responses so that accurately performed trials tend to precede other accurate trials. This relationship is disrupted by electrical stimulation of the nucleus at high frequency. Thus, the human subthalamic nucleus is involved in feedback-based learning.