A 13-year-old girl had to climb out of a bathroom window and down a drainpipe to escape a man who had raped her, a court has heard.
Alan Williams, 44, attacked the teenager while he was staying at her mother's house in 2018.
Liverpool Crown Court heard Williams raped the "vulnerable" girl after undressing her as she slept on a sofa.
Williams, formerly of Cross Street, Fraserburgh, Aberdeenshire, was jailed for 11 years.
The court was told the girl had been staying with her mother after running away from her grandmother's house, while Williams, who had been sofa-surfing after travelling to Merseyside to visit a relative, was also temporarily staying at the the house.
The jury heard that on the girl's mum was away and she was sleeping on the settee when she awoke to find Williams touching her.
She pretended to be asleep and he went on to partially undress her then rape her, prosecutor Robert Dudley said.
The 13-year-old, who gave evidence to the court, then fled to the bathroom, where she climbed barefoot out of the window, down the drainpipe and ran to her grandmother's house.
Williams was found guilty of rape, two offences of sexual assault and assault by penetration.
Sentencing him, Judge Robert Trevor-Jones said he had taken advantage of her youth and the fact there was no-one else in the house, adding that she had been particularly vulnerable because of her family background and her age.
Speaking after the hearing, Det Con Billy Williamson said it was "a truly awful offence which has devastated a young child".
"I want to praise her bravery for coming forward and allowing us to investigate," he said.
"At such a young age, there is no doubt that this has and will have a significant impact on her life but I hope with our continued support, she'll overcome this."