People are able to block out sound while they are sleeping thanks to a sensory gateway in the brain called the thalamus, American experts believe.
Brains of sleepers produce small bursts of electrical activity known as "sleep spindles".
Dr Jeffrey Ellenbogen from Harvard Medical School in Boston, who researched the effect, said: "The more sleep spindles your brain produces, the more likely you'll stay asleep, even when confronted by noise."
Researchers believe the increasing spindles through electronic devices, drugs or behavioural techniques could help light sleepers rest more easily.
But how this can be achieved is not yet clear.
The effect was seen in recordings of the brain wave patterns of 12 volunteers asked to endure noisy nights in a sleep laboratory.
For the first night, the volunteers were allowed to sleep undisturbed in quiet surroundings. Over the next two nights they were subjected to an array of disturbing noises, including a telephone ringing, people talking, and mechanical sounds of the sort of frequently heard in hospitals.
During sleep, brain waves become slow and organised, said Dr Ellenbogen. Sleep spindles are brief bursts of faster-frequency waves which stand out against the calm background.
They are generated by the thalamus, a checkpoint in the brain through which all kinds of sensory information pass, apart from smell signals, said the scientists.
The findings are published in the latest issue of the journal Current Biology.
Ways of enhancing the sleep spindle effect would be welcome in an increasingly noisy modern world, the researchers believe.
"Our sleeping environments have gotten increasingly complex and problematic, with all the beeps and boops of our 24/7 modern, crowded lives," said Dr Ellenbogen.
"And there are particular challenges in a hospital setting where some of the sounds are necessary (eg, heart monitors need to send an alarm if there's a problem).
"Our goal is to find brain-based solutions that integrate a sleeping person into their modern environment, such that sleep is maintained even in the face of noises. This finding gets us one important step closer to realising that goal."