Sleep allows the brain to rid itself of toxins that build up during waking hours through a "network of hidden caves", researchers said.
The function of sleep has been debated in science and philosophy for centuries, with some suggesting it consolidates memory and others saying it restores the body.
Research funded by the National Institute of Neurological Disorders and Stroke (NINDS) has found that the space between brain cells appears to increase during sleep in mice, allowing them to flush out toxins.
Study leader Maiken Nedergaard, from the University of Rochester Medical Centre in New York, said sleep changes the cellular structure of the brain and during this time, appears to cleanse itself.
Published in Science, the researchers found a plumbing system called the glymphatic system which, during sleep, opens to allow fluid to flow rapidly through the brain.
Roderick Corriveau, programme director of NINDS, said: "It's as if Nedergaard and her colleagues have uncovered a network of hidden caves and these exciting results highlight the potential importance of the network in normal brain function."
The team studied the plumbing system by injecting dye into the cerebrospinal fluid (CSF) of mice and monitoring it while watching brain activity. When the mice were asleep, the fluid flowed rapidly but hardly moved during waking hours.
Nedergaard said: "We were surprised by how little flow there was into the brain when the mice were awake. It suggested that the space between brain cells changed greatly between conscious and unconscious states ... We need sleep. It cleans up the brain."
The team then used electrodes to measure the space between brain cells and found there were "dramatic changes" between times of sleep and wakefulness.
The researchers believe their finding could result in treatments for neurological disorders including Alzheimer's as previous studies have found toxic molecules involved in these diseases build up in the space between brain cells.
Jim Koenig, from the NINDS, said: "These results may have broad implications for multiple neurological disorders. This means the cells regulating the glymphatic system may be new targets for treating a range of disorders."