The findings suggest a biological purpose for sleep and indicate that waste disposal may underlie its restorative properties.
There could also be implications for understanding and treating diseases such as Alzheimer's.
"This study shows that the brain has different functional states when asleep and when awake," said US researcher Dr Maiken Nedergaard, from the University of Rochester.
"In fact, the restorative nature of sleep appears to be the result of the active clearance of the by-products of neural activity that accumulate during wakefulness."
The findings, published in the journal Science, show that the brain's unique method of cleansing itself is highly active during sleep. It clears away toxins that would otherwise build up and trigger neurological disorders such as Alzheimer's disease.
The purpose of sleep has vexed both philosophers and scientists since ancient Greek times. From an evolutionary perspective, sleep is a puzzle. Virtually every animal species, from fruit flies to whales and humans needs some form of sleep.
Yet being asleep has significant drawbacks, such as leaving an animal at the mercy of predators, and using up time that could be better spent foraging or looking for mates.
Recent research has shown that sleep can help the brain store and consolidate memories, but these benefits are not thought to outweigh its disadvantages.
This has led scientists to suspect that sleep must have a more essential biological function. The new findings hinge on the discovery of a previously unknown brain waste disposal system.
Scientists speculated that the cleaning process may not be compatible with functions the brain must perform while awake and actively processing information.
"These findings have significant implications for treating 'dirty brain' disease like Alzheimer's," said Dr Nedergaard. "Understanding precisely how and when the brain activates the glymphatic system and clears waste is a critical first step in efforts to potentially modulate this system and make it work more efficiently."