Multiple brain regions have been implicated in the control of sleep, wakefulness and the transitions between rapid eye movement (REM) sleep and non-REM (NREM) sleep; however, the circuits involved are poorly understood. Two recent papers have combined optogenetics with neuronal activity recordings to investigate the cell types and pathways controlling sleep in the mouse. Xu et al. showed that three populations of basal forebrain neurons — namely, glutamatergic, cholinergic, and parvalbumin-expressing GABAergic neurons — are hierarchically connected and drive wakefulness. By contrast, somatostatin-expressing GABAergic basal forebrain neurons inhibited the wake-promoting neurons and induced NREM sleep. Weber et al. identified a GABAergic population of neurons in the ventral medulla that project rostrally to the pons and midbrain to drive NREM–REM sleep transitions and maintain REM sleep. These papers thus begin to dissect the complex circuitry mediating sleep control and may provide tools to evaluate sleep function.