Darrell Swanson, 39, claimed he suffered from a rare psychological condition called "sexsomnia" which meant he was completely unaware he was having intercourse during the night.
Swanson, from Dunfermline 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 Swanson's 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 – claimed 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 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 Swanson 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.
Swanson started trembling in the dock as the verdicts were read out and appeared to blink back tears.
In an emotional scene, his wife rushed to hug him as he left the well of the court and sobbed quietly in his arms before they left the courtroom together.