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.