The pathophysiology of periodic limb movements and sensory leg discomfort in the restless legs syndrome is unknown. With high-resolution functional magnetic resonance imaging, we localized for the first time cerebral generators associated with sensory leg discomfort and periodic limb movements in 19 patients with restless legs syndrome. During sensory leg discomfort there was mainly bilateral activation of the cerebellum and contralateral activation of the thalamus. During the combined periodic limb movement and sensory leg discomfort conditions, patients also showed activity in the cerebellum and thalamus. In contrast to the sensory leg discomfort condition alone, the combined condition was associated with additional activation in the red nuclei and brainstem close to the reticular formation. Voluntary imitation of periodic limb movements by patients and control subjects was not associated with brainstem activity, but with additional activation in the globus pallidus and motor cortex. These findings indicate that cerebellar and thalamic activation may occur because of sensory leg discomfort and that the red nucleus and brainstem are involved in the generation of periodic limb movements in patients with restless legs syndrome.