From invertebrates to humans, a defining feature of sleep is behavioral immobility(Campbell and Tobler, 1984; Hendricks et al., 2000; Shaw et al., 2000). In mammals, diminished electromyographic (EMG) activity is a major criterion for both rapid eye movement (REM) and non-REM (NREM) sleep. However, the relationship between sleep and motor control at the neuronal level remains poorly understood. Here we show that regions of the basal ganglia long known to be essential for motor suppression also play a key role in sleep generation. Optogenetic or chemogenetic activation of GABAergic neurons in mouse substantia nigra pars reticulata (SNr) strongly increased both REM and NREM sleep, whereas their inactivation suppressed sleep and increased wakefulness. Analysis of natural home-cage behavior showed that mice transition sequentially through several behavioral states: locomotion, non-locomotor movement, quiet wakefulness, and sleep. Activation/inactivation of SNr neurons promoted/suppressed sleep by biasing the direction of progression through the natural behavioral sequence. Virus-mediated circuit tracing showed that SNr GABAergic neurons project to multiple wake-promoting monoaminergic cell groups in addition to the thalamus and mesencephalic locomotor region, and activating each projection promoted sleep. Within the thalamus, direct optogenetic inactivation of glutamatergic neurons is sufficient to enhance sleep, but the effect is largely restricted to the regions receiving SNr projection. Furthermore, a major source of excitatory inputs to the SNr is the subthalamic nucleus (STN), and activation of neurotensin-expressing glutamatergic neurons in the STN also promoted sleep. Together, these results demonstrate a key role of the STN-SNr basal ganglia pathway in sleep generation and reveal a novel circuit mechanism linking sleep and motor control.