A judge has criticised a hospital for failings that allowed a known sex offender to attack a vulnerable sedated patient on a mental health ward.

Muhammad Abdul Aziz was a patient in Newham Centre for Mental Health when he sexually assaulted the woman last year.

Snaresbrook Crown Court heard that staff should have been checking on Aziz and other patients every 15 minutes. But CCTV showed the 26-year-old prowling the corridors of the women's ward in the early hours of the morning.

Aziz, of Heathway, Dagenham, peered into several women's rooms before entering the victim's room — where he spent 51 minutes undisturbed.

Judge Sandy Canavan said: "There was an absence of supervision. [Aziz] was at large an hour without anyone noticing.

"He was supposed to be on 15-minute supervision. The fact that didn't happen is an enormous cause for concern. If someone had done their job properly, he would not have had the opportunity to commit this offence."

The woman reported the assault to the hospital that morning but it took staff two days to phone police.

Her heavy sedation meant she was powerless to fight him off.

Prosecutor Martin Hooper said: "The victim was vulnerable and heavily medicated.

"She tried to scream and get him off her. Her legs weren't working properly."

He added: "It was prolonged. [The victim] was drugged and unable to move."

CCTV showed Aziz left the victim after almost an hour and then continued to prowl the corridors before going back into her room. It was then that staff arrived and escorted him back to his bed.

During questioning Aziz told officers: "If someone is asleep and you have sex with them then that is not rape."

Aziz had committed a string of sexual and violent offences in the past, including exposing himself in public and sexually touching a 13-year-old child.

He was on bail when he entered the mental health hospital having pleaded guilty to battery. There was no security between Aziz's bed and the women's rooms.

His mental health problems were exacerbated by his drink and drug use which made him "sexually uninhibited", the court heard.

Aziz admitted assault by penetration at an earlier hearing. On Friday, July 26 he was jailed for five years with a five year extended licence period, and he will have to sign the sex offender register for life.

He will start his sentence in a mental health hospital before being moved to prison when doctors deem him well enough.

A spokesman for the East London NHS Foundation Trust, which runs Newham Centre for Mental Health, said: "An investigation into what went wrong found that there had been failures in standard procedure.

"In the wake of the incident being reported to our staff, we did our best to ensure that the victim and her family were able to access appropriate counselling and support. We extend our sincere apologies to the victim."