Image copyright EPFL Image caption The researchers created an experiment that made some participants feel a ghost was present in the room

Feelings of a ghostly presence - the sense that someone is close-by when no-one is there - lie in the mind, a study has concluded.

Scientists say that they have identified the parts of the brain that are responsible for generating these spooky sensations.

They have also created an experiment that makes some people feel like there is a ghost nearby.

The research is published in the journal Current Biology.

There are many tales of the paranormal, but an often-reported phenomenon is that of the invisible apparition.

Dr Giulio Rognini, from the Swiss Federal Institute of Technology (EPFL), says: "The sensation is very vivid. They feel somebody but they cannot see it. It is always a felt presence."

He said it was common in those who experience extreme conditions, such as mountaineers and explorers, and people with some neurological conditions, among others.

"What is astonishing is that they frequently report that the movements they are doing or the posture they are assuming at that specific moment is replicated by the presence. So if the patient is sitting, they feel the presence is sitting. If they are standing, the presence is standing, and so on," he explained.

Image copyright EPFL Image caption Some of the participants asked for the experiments to stop because the sensation was so odd

To investigate, the researchers scanned the brains of 12 people with neurological disorders, who had reported experiencing a ghostly presence.

They found that all of these patients had some kind of damage in the parts of the brain associated with self-awareness, movement and the body's position in space.

Our brain possesses several representations of our body in space Dr Giulio Rognini, EPFL

In further tests, the scientists turned to 48 healthy volunteers, who had not previously experienced the paranormal, and devised an experiment to alter the neural signals in these regions of the brain.

They blindfolded the participants, and asked them to manipulate a robot with their hands. As they did this, another robot traced these exact movements on the volunteers' backs.

When the movements at the front and back of the volunteer's body took place at exactly the same time, they reported nothing strange.

But when there was a delay between the timing of the movements, one third of the participants reported feeling that there was a ghostly presence in the room, and some reported feeling up to four apparitions were there.

Two of the participants found the sensation so strange, they asked for the experiments to stop.

The researchers say that these strange interactions with the robot are temporarily changing brain function in the regions associated with self-awareness and perception of the body's position.

The team believes when people sense a ghostly presence, the brain is getting confused: it's miscalculating the body's position and identifying it as belonging to someone else.

Dr Rognini said: "Our brain possesses several representations of our body in space.

"Under normal conditions, it is able to assemble a unified self-perception of the self from these representations.

"But when the system malfunctions because of disease - or, in this case, a robot - this can sometimes create a second representation of one's own body, which is no longer perceived as 'me' but as someone else, a 'presence'."

The researchers said that their findings could help to better understand neurological conditions such as schizophrenia.

Follow Rebecca on Twitter