A DUNFERMLINE man accused of rape trembled with relief after a jury believed his claim that he was unaware he was having sex because he was asleep.

The wife of Darrell Swanson, 39, rushed to hug him after the verdict was announced and sobbed quietly in his arms before they left the courtroom together.

It was suggested that he suffered from a rare psychological condition called "sexsomnia", which meant he was completely unaware he was having intercourse during the night, although he told the court he had never undergone therapy for it as one of the alleged victims claimed.

Swanson had denied three historic rapes, two of them involving a woman now aged 36 and a third involving her younger sister, now aged 30.

During the trial at the High Court at Livingston, Dr Ian Morrison, a consultant neurologist with NHS Tayside and a specialist in sleep medicine, gave evidence that it was “entirely possible” that his defence was true.

He said: “It’s almost exclusively the case that there’s a lack of recall. Generally speaking patients do not recall.

“Some see it as a bit of a joke and laugh it off. Some find it very embarrassing and some are sympathetic to the position.”

Asked about Swanson’s admitted episodes of “nocturnal groping behaviour” – grabbing the breasts and thighs of women he slept with – Dr Morrison said that could be another symptom of the condition.

He said “sexual behaviour” in sleep was not exclusively intercourse but could include other acts.

He added: “He has a history of sleepwalking, also of jumping out of his bed because he thinks things like spiders are in his bed. We know from his wife that he talks in his sleep as well.”

Dr Morrison said factors such as sleep deprivation, stress, anxiety or drinking alcohol could trigger a sexsomnia episode but admitted there was no diagnostic test for a sleep disorder.

Swanson claimed in evidence that he had money worries after losing his job as a bus driver and admitted drinking alcohol before some of the alleged incidents.

The woman who claimed he raped her – an NHS worker from Fife – said she had wakened on half a dozen occasions to find Swanson having sex with her.

The mum of three said the accused had his eyes open when she turned to stop him, but when she challenged him about the incidents the following morning he told her he didn’t remember them happening.

She said: "I’d come to the conclusion this was something he did on his sleep and had no control over it. There wasn’t very much I could do to stop it.

“Every time it happened I would say ‘It’s happened again last night’. Again he would just say he didn’t remember, he didn’t remember."

She said she had found out about the rare disorder on Google, but her initial belief that Swanson might be suffering from it changed when he answered her one night as if completely awake.

She said his comment 'That's how you want to finish this?' had put a massive seed of doubt in her head and led to her going to the police.

She said her sister also filed a complaint alleging she'd been raped in her sleep after a drinking session with the accused when she was aged 15 or 16.

The jury, based in a cinema 26 miles from the court, took less than an hour and a half to return 'not proven' verdicts on all three charges.

Judge Lady Poole told Swanson the jury's majority verdicts meant that he was acquitted and free to leave the dock.

He started trembling in the dock as the verdicts were read out and appeared to blink back tears.

Experts say sexsomnia is most likely to occur in deep sleep, when thinking and awareness is switched off, but the part of the brain responsible for basic urges is still active.

The condition has been a storyline in television drama programmes such as House, Law and Order and Desperate Housewives.

In 2012 Hollyoaks actor Simon Morris was jailed for eight years after being found guilty of raping a 15-year-old girl. He had claimed he suffered from sexsomnia but, unlike Swanson's case the jury did not believe him.