Reading dreams has come a step closer to reality after scientists predicted the content of images in the heads of napping volunteers.
Using a brain scanner to map neural activity, they were able to identify broad categories of what were seen in dreams with 60% accuracy.
Technology that can uncover the surreal hidden world of dreams has long been a mainstay of science fiction.
The new work is a far cry from the movie Inception, in which people get inside each others' dreams. But it could provide a way of unlocking some of the secrets of the dreamer, with implications for psychological therapy and sleep research.
The experiments, conducted in Japan, involved three volunteers who were encouraged to take naps in a functional magnetic resonance imaging (fMRI) machine.
Researchers led by Dr Yuki Kamitani, from the ATR Computational Neuroscience Laboratories in Kyoto, started off by monitoring the brain activity of lightly sleeping volunteers for signs of dream hallucinations.
When they appeared to be dreaming, participants were woken up and asked to describe their visual experiences.
After gathering around 200 dream reports from each subject, repeated elements such as "tree" or "man" were grouped into roughly 20 broad categories. These were tailored to each participant. In one case, "ice pick", "key" and "plunger" were all placed in the category "implement".
Recordings from the fMRI brain scans were examined for activity patterns that coincided with the dream categories. Volunteers were also asked to look at photos from the internet corresponding to their dreams while their brain activity was monitored.
The data were used to train a computer programme to recognise the brain activity "signatures" associated with different types of dream image, while weeding out non-visual brain activity during sleep.
In a second round of dreaming by the same three, the programme successfully predicted what kind of images each volunteer was dreaming about with 60% accuracy.
The team wrote in the journal Science: "Our findings provide evidence that specific contents of visual experience during sleep are represented by, and can be read out from, visual cortical activity patterns shared with stimulus representation."
The scientists expected the research to "lead to a better understanding of the functions of dreaming".
US neuroscientist and dream expert Dr Robert Stickgold, from Harvard Medical School in Boston, described the study as "stunning in its detail and success".
He told Science: "This is probably the first real demonstration of the brain basis of dream content."
Dr Stickgold said the research proved, for the first time, that when people describe their dreams they are at least close to being accurate.
"Up until this moment, there were no grounds on which to say we don't just make up our dreams when we wake up," he added.