Scientists have shown relying on the sleep-deprived brain to perform well is potentially fraught with danger.
They found that even after sleep deprivation, people have periods of near normal brain function in which they can finish tasks quickly.
However, this is mixed with periods of slow response and severe drops in visual processing and attention.
The study, by Duke University and the National University of Singapore, appears in the Journal of Neuroscience.
The researchers said the findings had implications for people who have to struggle through night work, from long distance lorry drivers to on-call doctors.
Lead researcher Professor Michael Chee said: "The periods of apparently normal functioning could give a false sense of competency and security when, in fact, the brain's inconsistency could have dire consequences."
The researchers found that a sleep-deprived brain can normally process simple visuals, like flashing checkerboards.
However, the "higher visual areas" - those responsible for making sense of what we see - didn't function well.
As Professor Chee put it: "Herein lies the peril of sleep deprivation."
The researchers used a technique called magnetic resonance imaging to measure blood flow in the brain as a way to gauge activity.
Study subjects, who were either kept awake all night or allowed a good night's sleep, were asked to identify letters flashing briefly in front of them.
They saw either a large H or S, and each was made up of smaller Hs or Ss.
Sometimes the large letter matched the smaller letters; sometimes they didn't.
Scientists asked the volunteers to identify either the smaller or the larger letters by pushing one of two buttons.
During slow responses, sleep-deprived volunteers had dramatic decreases in their higher visual cortex activity.
At the same time their frontal and parietal 'control regions' were less able to make their usual corrections - in effect they failed to kick in for these lapses in attention.
Scientists also could see brief failures in the control regions during the rare lapses that volunteers had after a normal night's sleep.
However, the failures in visual processing were specific only to lapses that occurred during sleep deprivation.
Dr Clifford Saper, of Harvard University, said: "The main finding is that the brain of the sleep-deprived individual is working normally sometimes, but intermittently suffers from something akin to power failure."
Dr Neil Stanley, a sleep expert from Norfolk and Norwich University Hospital, said the study appeared to prove what scientists had long suspected.
"It is worrying for night workers as it suggests they can potentially convince themselves they are performing OK but they are liable to lapses."
Dr Stanley said there was evidence to suggest that sleep-deprived people could perform simple tasks, and interesting complex tasks well.
The problem came in performing relatively complicated, but essentially boring tasks, such as driving.
Dr Andrew Cummin, of the Imperial College Healthcare Sleep Centre, said: "Sleep deprivation is believed to have contributed to major disasters ranging from the major oil spillage of the Exxon Valdez to the nuclear meltdowns of Three Mile Island and Chernobyl.
"But whether anything much can be done about this is doubtful. For the time being the only solution we have is to make sure we all get enough sleep."