Freezing of gait is a common, debilitating feature of Parkinson's disease. We have studied gait planning in patients with freezing of gait, using motor imagery of walking in combination with functional magnetic resonance imaging. This approach exploits the large neural overlap that exists between planning and imagining a movement. In addition, it avoids confounds introduced by brain responses to altered motor performance and somatosensory feedback during actual freezing episodes. We included 24 patients with Parkinson's disease: 12 patients with freezing of gait, 12 matched patients without freezing of gait and 21 matched healthy controls. Subjects performed two previously validated tasks--motor imagery of gait and a visual imagery control task. During functional magnetic resonance imaging scanning, we quantified imagery performance by measuring the time required to imagine walking on paths of different widths and lengths. In addition, we used voxel-based morphometry to test whether between-group differences in imagery-related activity were related to structural differences. Imagery times indicated that patients with freezing of gait, patients without freezing of gait and controls engaged in motor imagery of gait, with matched task performance. During motor imagery of gait, patients with freezing of gait showed more activity than patients without freezing of gait in the mesencephalic locomotor region. Patients with freezing of gait also tended to have decreased responses in mesial frontal and posterior parietal regions. Furthermore, patients with freezing of gait had grey matter atrophy in a small portion of the mesencephalic locomotor region. The gait-related hyperactivity of the mesencephalic locomotor region correlated with clinical parameters (freezing of gait severity and disease duration), but not with the degree of atrophy. These results indicate that patients with Parkinson's disease with freezing of gait have structural and functional alterations in the mesencephalic locomotor region. We suggest that freezing of gait might emerge when altered cortical control of gait is combined with a limited ability of the mesencephalic locomotor region to react to that alteration. These limitations might become particularly evident during challenging events that require precise regulation of step length and gait timing, such as turning or initiating walking, which are known triggers for freezing of gait.