A sex offender who assaulted a woman and took pictures of her as she slept has been jailed for four and a half years.

William Wilson Allan sexually assaulted his victim after drinking with her and her partner, York Crown Court heard.

Allan had recently been released from a prison sentence for an unrelated offence in which he had threatened to firebomb another man’s house with the man, his wife and family inside.

Allan, 27, of York, had denied sexual assault and voyeurism, but was convicted by a jury.

As well as jailing him, Recorder Simon Jackson KC made him subject to a restraining order banning him from contacting the woman in any way for 10 years.

Allan will also be on the sex offenders’ register for life.

Last month, a jury heard how Allan, the victim of the sexual assault and her partner had gone to the woman’s house together after drinking together at a different house.

Allan and the woman’s partner left her alone at the house while they went to buy cocaine in the early hours of May 1, 2021.

Believing they had gone for the night, she went upstairs and fell asleep, leaving her phone by her bedside.

But shortly afterwards the men came back, with some cocaine which they used. She was unaware of their return.

The partner told the jury how Allan had started using the woman’s phone and walking up and down the stairs.

He had left the house, leaving Allan alone in the house with the woman.

While he was out, Allan had gone upstairs and used the woman’s phone to take pictures of her as she slept, the jury heard.

As he took the photographs, he sexually assaulted her.

He deleted the photographs, but the woman found them some hours later in the phone’s deleted section.

She told the jury she knew who had taken the photographs because they included a blackened fingernail – and she knew that Allan had had an injured fingernail at the time.

Following his arrest and in court, Allan tried to blame the partner, claiming the partner had taken the photographs.

But the partner didn’t have a damaged fingernail, and police took photos of his hand shortly after the crime showing he didn’t have a damaged fingernail, the jury heard.

A year ago, Allan was jailed for 18 months for criminal damage and threats to commit criminal damage to a man's house.

York Crown Court heard last December how he had been drinking and taking drugs before those offences.

He has other previous convictions, including for violence but none for sexual offences.