A convicted rapist who claimed he should have not been found guilty because his actions were carried out while he was asleep has had his legal appeal rejected by the Supreme Court.
The man, who has name suppression, claimed to suffer from "sexsomnia", a condition where people carry out sex acts unknowingly in their sleep.
The man was convicted of raping and indecenty assaulting his wife.
She at first believed he was suffering from sexsomnia, but later came to have doubts.
The man's lawyer, Paul Dacre, argued the prosecution needed to prove the man was awake at the time of the offences.
But the Supreme Court ruled that the judge in the trial had directed the jury on the issue, and the jury had rejected the view that the man's actions were not deliberate.
No one at the trial had given evidence that the man had been diagnosed as suffering from sexsomnia and it was merely a possibility that he did have the condition, the court said in its judgment.
It said his wife had made it clear she did not want to have sex with her husband while she was asleep.
While at first she accepted his claim, she later came to have doubts when he admitted to being awake during some of the offences.
The man is serving a five-year jail sentence.
The defence of sexsomnia has been used as a defence in rape cases overseas. The best known case is that of the British soap opera actor Simon Morris, who was convicted of the rape of a teenage girl in 2012 despite claiming to have the condition.