Scientists have long known that sleep plays an important role in memory formation, but how this physically happens hasn't been understood.
But now, using advanced microscopy, a team from the US and China have witnessed the formation of new connections between synapses during sleep, proving the role sleep plays in creating memories.
Professor Wen-Biao Gan from New York University told the BBC: "Finding out sleep promotes new connections between neurons is new; nobody knew this before."
"We thought sleep helped, but it could have been other causes, and we show it really helps to make connections and that in sleep the brain is not quiet, it is replaying what happened during the day and it seems quite important for making the connections."
The mice were engineered to express a glowing fluorescent protein in their brain cells, which could be studied by the scientists.
To study the process, scientists taught mice to walk on a rotating rod, a new skill, and then afterwards compared the growth of neuronal connections as they either slept or stayed awake.
The results were published in Science, and showed that the most new neuron connections formed during deep sleep.
The researchers also found that the same brain cells activated during training were reactivated during this slow-wave deep sleep, and the connections that grew changed depending on what skill was learnt.
So now the only question left is, how do we find enough hours in the day to sleep the ideal amount?