The brain uses sleep to wash away the waste toxins built up during a hard day's thinking, researchers have shown.
The US team believe the "waste removal system" is one of the fundamental reasons for sleep.
Their study, in the journal Science, showed brain cells shrink during sleep to open up the gaps between neurons and allow fluid to wash the brain clean.
They also suggest that failing to clear away some toxic proteins may play a role in brain disorders.
One big question for sleep researchers is why do animals sleep at all when it leaves them vulnerable to predators?
It has been shown to have a big role in the fixing of memories in the brain and learning, but a team at the University of Rochester Medical Centre believe that "housework" may be one of the primary reasons for sleep.
"The brain only has limited energy at its disposal and it appears that it must choose between two different functional states - awake and aware or asleep and cleaning up," said researcher Dr Maiken Nedergaard.
"You can think of it like having a house party. You can either entertain the guests or clean up the house, but you can't really do both at the same time."Plumbing
Their findings build on last year's discovery of the brain's own network of plumbing pipes - known as the glymphatic system - which carry waste material out of the brain.
Scientists, who imaged the brains of mice, showed that the glymphatic system became 10-times more active when the mice were asleep.
Cells in the brain, probably the glial cells which keep nerve cells alive, shrink during sleep. This increases the size of the interstitial space, the gaps between brain tissue, allowing more fluid to be pumped in and wash the toxins away.
Dr Nedergaard said this was a "vital" function for staying alive, but did not appear to be possible while the mind was awake.
She told the BBC: "This is purely speculation, but it looks like the brain is losing a lot of energy when pumping water across the brain and that is probably incompatible with processing information."
She added that the true significance of the findings would be known only after human studies, but doing similar experiments in an MRI machine would be relatively easy.
Commenting on the research Dr Neil Stanley, an independent sleep expert, said: "This is a very interesting study that shows sleep is essential downtime to do some housekeeping to flush out neurotoxins.
"There is good data on memory and learning, the psychological reason for sleep. But this is the actual physical and chemical reason for sleep, something is happening which is important."
Dr Raphaelle Winsky-Sommerer, a lecturer in sleep at Surrey University, said: "It's not surprising, our whole physiology is changing during sleep.
"The novelty is the role of the interstitial space, but I think it's an added piece of the puzzle not the whole mechanism.
"The significance is that, yet again, it shows sleep may contribute to the restoration of brain cell function and may have protective effects."
Many conditions which lead to the loss of brain cells such as Alzheimer's or Parkinson's disease are characterised by the build-up of damaged proteins in the brain.
The researchers suggest that problems with the brain's cleaning mechanism may contribute to such diseases, but caution more research is needed.
The charity Alzheimer's Research UK said more research would be needed to see whether damage to the brain's waste clearance system could lead to diseases like dementia, but the findings offered a "potential new avenue for investigation".