Our noses can quickly learn to link even subtle changes in smell with danger, claim scientists.
Volunteers who could not differentiate between two similar smells found they could do it easily after being given a mild electric shock alongside one.
Brain scans confirmed the change in the "smelling" part of the brain.
The US research, published in the journal Science, suggests our distant ancestors evolved the ability to keep us away from predators.
The 12 volunteers were exposed to two "grassy" odours, and none of them could accurately tell the difference between them.
After they were shocked while smelling one of them, they developed the ability to discriminate between the two.
Researcher Dr Wen Li, of the Feinberg School of Medicine, Northwestern University, in Chicago, said: "It's evolutionary. This helps us to have a very sensitive ability to detect something that is important to our survival from an ocean of environmental information.
"It warns us that it's dangerous and we have to pay attention to it."
MRI scans, which can measure brain activity, revealed clear differences in a part of the brain called the olfactory cortex before and after the shocks.
Dr Geraldine Wright, from the University of Newcastle has carried out similar work in animals - and says that fundamentally, the human smell system is designed in the same way.
She said that the sensitivity of the human nose was not vastly inferior to many other creatures.
"In terms of the number of olfactory receptors in our noses, we do pretty well compared to some other species, and we can sense a lot of different smells.
"If the brain has to remember some detail in order to avoid a bad outcome, it will do it pretty quickly."