A man who claimed he was sleepwalking when he raped a 17-year-old girl has been jailed for six years.
Zack Thompson, 20, maintained his defence for two-and-a-half years before finally admitting he raped the girl at a Portuguese holiday resort in 2009.
Thompson's case is thought to be just the second in Britain, and the first in England, where a sleepwalking defence has been successfully challenged.
Glaswegian man John Docherty was found guilty of attempted murder in 2011 despite claiming he was sleepwalking at the time.
Sentencing Thompson, of Lincoln Street, Newark, at Nottingham Crown Court today, Judge John Milmo QC said his crime has had a devastating effect on the victim.
"She said 'I did nothing wrong', and she was absolutely right," the judge said.
"I only hope that today will mark an occasion when she can go back to being the happy young girl she used to be."
Opening the case for the Crown today, prosecutor Dawn Pritchard said Thompson was 18 when he raped the girl, who is now 19, while they were on holiday in Albufeira on September 12, 2009.
He said he had drunk seven or eight pints during the evening and before the offence, but could not remember anything after that.
Miss Pritchard said that when asked if he had raped her, he said: "I can't remember, maybe."
The victim returned to the UK immediately after the rape and reported it to the police.
When Thompson returned to the UK he handed himself into Newark Police Station, Nottinghamshire Police said.
He did not deny committing the act but refused to take criminal responsibility from the outset, claiming he was sleepwalking and had no memory of the attack.
The judge told him today that he could not rule out the possibility that his amnesia was genuine.
Reading from a victim impact statement, Miss Pritchard told the court the girl found the experience "devastating and humiliating".
She went on: "For the past two and a half years she's had to cope with what happened to her and waiting for this matter to resolve has been very difficult for her.
"It affected every part of her life.
"She's no longer her carefree, happy go-lucky self and finds that she is depressed.
"She feels she's serving a sentence because of what's happened to her."
Nottinghamshire Police said that from when the crime was reported in 2009 they sought expert advice and guidance from all over the UK and abroad about the relatively unknown world ofsleepwalking as a criminal defence, a force spokeswoman said.
After liaising with the National Police Improvement Agency, lead investigator Detective Constable Paula Winfield was referred to sleep disorder expert Professor Mark Pressman, an American psychologist with over 30 years experience in diagnosing and treating sleep-related disorders.
He travelled to Nottinghamshire, where he carried out an in-depth review of the evidence, including an interview with Thompson himself, and found that his behaviour during the incident was not consistent with the actions normally displayed by sleepwalkers.
The expert also found that Thompson's memory loss began around half an hour before he went to bed, and concluded his memory loss was highly likely to have been the result of drinking excessive amounts of alcohol, and not sleepwalking.
Thompson finally withdrew the sleepwalking defence after it was successfully challenged.
Nottinghamshire Police said Thompson went on to claim, however, that he was insane when he committed the rape.
He was assessed by an expert psychiatrist, who rejected his claims of insanity, and he finally pleaded guilty at a hearing at Nottingham Crown Court on March 1 this year.
A joint statement from the victim and her family, said the last two and a half years had been "exhausting and emotionally draining for us all".
They went on: "We have faced repeated disappointment and countless adjournments at court, which has been extremely frustrating and disheartening.
"Dealing with such a traumatic event changes everything - it has pulled the family apart, but it's also brought us together and made us stronger as a family too.
"When this happened to her, she was still a child and struggled to grasp the enormity of what happened to her.
"She has had to grow up very quickly and has had to deal with feelings and emotions that no young woman should have to."
The victim and her family said there had been many times they felt like dropping the case and giving up, but knew they could not if they wanted to achieve justice.
The statement added: "We are thrilled that justice has been done and that he will finally have to pay for what he did - but the ordeal does not end here.
"We have not walked away from court today free of this nightmare and, though we are hopeful for the future, we are sure our lives will never be the same again."
Speaking outside court, Detective Constable Paula Winfield, who led the investigation, said she was pleased with Thompson's sentence and that it had followed years of relentless work and sheer determination.
She said: "Sleepwalking as a criminal defence had never been successfully challenged in a sexual offence case before.
"But we could not let that discourage us from doing all we could to achieve justice for a young woman who has been through such a traumatising ordeal.
"Thompson has had nearly three years to admit what he did and accept responsibility, but instead he chose to prolong the suffering and uncertainty for his victim.
"I've seen first hand what she has been through and know that the last two-and-a-half years have had a profound effect on her - the courage and patience she has shown has been astonishing.
"Today has been a triumph for the British legal system, but more importantly for the victim who has been at the centre of it all.
"I hope that this courageous young lady will now be able to begin to heal and move forward in the knowledge that her attacker is in prison where he belongs."