Lapses of attention manifest as delayed behavioral responses to salient stimuli. Although they can occur even after a normal night's sleep, they are longer in duration and more frequent after sleep deprivation (SD). To identify changes in task-associated brain activation associated with lapses during SD, we performed functional magnetic resonance imaging during a visual, selective attention task and analyzed the correct responses in a trial-by-trial manner modeling the effects of response time. Separately, we compared the fastest 10% and slowest 10% of correct responses in each state. Both analyses concurred in finding that SD-related lapses differ from lapses of equivalent duration after a normal night's sleep by (1) reduced ability of frontal and parietal control regions to raise activation in response to lapses, (2) dramatically reduced visual sensory cortex activation, and (3) reduced thalamic activation during lapses that contrasted with elevated thalamic activation during nonlapse periods. Despite these differences, the fastest responses after normal sleep and after SD elicited comparable frontoparietal activation, suggesting that performing a task while sleep deprived involves periods of apparently normal neural activation interleaved with periods of depressed cognitive control, visual perceptual functions, and arousal. These findings reveal for the first time some of the neural consequences of the interaction between efforts to maintain wakefulness and processes that initiate involuntary sleep in sleep-deprived persons.