Disrupting brain activity in sleeping mice, specifically during the rapid eye movement (REM) phase, can stop the animals remembering things they learned that day, a study suggests.
It is the clearest evidence to date that REM sleep is critical for memory.
By switching off certain brain cells, the researchers silenced a particular, rhythmic type of brain function - without waking the mice.
If they did this during REM sleep, the mice failed subsequent memory tests.
The research is reported in the journal Science.
REM sleep is the phase during which, at least in humans, dreams take place - but the question of whether it is important for settling new memories has been difficult to answer.
Recent studies have tended to focus on deep, non-REM sleep instead, during which brain cells fire in various patterns that reflect memory consolidation and "re-play" of the day's experiences.
During REM sleep, while our eyes flicker and our muscles relax, exactly what the brain is doing is something of a mystery. But it is a type of sleep seen across the animal kingdom, in mammals and birds and even lizards.
Learn more about sleep with BBC iWonder:
Especially in animals, REM phases can be quite fleeting. This and other complications have made it difficult to test what effect such sleep has.
Simply waking up humans or animals when they enter the REM phase, for example, causes stress and other problems that can confound any memory tests.
So Dr Sylvain Williams, from McGill University in Canada, working with colleagues at the University of Bern, Switzerland, decided to meddle directly with the sleeping brain.
"What we did was we used a technique, in mice, to solely disrupt REM sleep activity," Dr Williams told BBC News.
Using the system known as "optogenetics", he and his colleagues were able to control a particular population of brain cells in the mice, just by shining light through a tiny, implanted optical fibre.
Whenever they switched on the light, they drastically reduced a particular rhythm in the brain, called "theta oscillations".
And if that disruption was delivered during a mouse's REM sleep, there were consequences.
"Disrupting the activity only during REM sleep, and not other sleep, basically obliterates consolidation and memory formation," Dr Williams said.
For example, if it was shown one brand new object and one that it had seen the day before, the mouse would thoroughly investigate both, instead of concentrating - like a normal mouse would - on the unfamiliar one.
Optogenetics: switches for brain circuits
- Technique developed in flies, and then mice, during the early 2000s
- Allows researchers to control brain cells (neurons) with coloured light
- Uses genetic engineering to put light-sensitive ion channels, originally found in algae, into neurons
- These change the flow of electrical charge and activate or silence the neurons
- To deliver the light, a thin optical fibre can be implanted into the brain
- Once in place, the light beam - and the targeted neurons - can be switched on and off at will
So it seems that REM sleep is crucial, in some cases, for laying down new memories. Dr Williams said this arguably poses more questions than it answers.
For one thing, the other, deeper phase of sleep is already known to be involved in memory consolidation. So what are their distinct jobs?
"I think at the moment we don't know the difference between the two phases," he said.
"It's an eye-opener to say that REM sleep has this very central role."
Whatever that role is, the new findings suggest it involves the oscillations that the scientists disrupted - in which brain cells synchronise their activity, leading to a widespread and measurable rhythm with, in this case, about seven beats per second.
That signature could be something to study in patients with dementia or other memory problems, Dr Williams said.
"It'd be interesting to see, for example, how this normal activity... might be affected, specifically, in Alzheimer's patients. To see if that contributes to memory impairments."
Dr Daniel Bendor, a neuroscientist at University College London who also studies memory formation in rodents, said the study was "a big step forward" in understanding REM sleep.
"After decades of work that's been inconclusive, they're showing that something important is happening," he said.
The Swiss-Canadian team had found a neat way of specifically disrupting REM sleep, Dr Bendor added.
"These are difficult experiments to do. It's a really impressive demonstration of a potential role of theta oscillations during REM sleep."
Follow Jonathan on Twitter
Importance of sleep
A different, 2015 study in mice showed that regular deep sleep helps to clear the brain of amyloid - a protein that builds up in Alzheimer's disease.