A girl was raped by a school caretaker who was later joined by a deputy head teacher in subjecting her to a catalogue of horrifying sexual abuse, a jury was told.

The pair, who worked at a school in Otley until the mid 1980s, carried out the attacks as a form of "sexual punishment", Leeds Crown Court was told.

A second girl was also raped regularly by caretaker Desmond O'Donnell, 59, the jury heard.

O'Donnell is charged with eight counts of rape, 11 counts of indecent assault, four counts of another serious sexual offence, and one count of taking indecent photographs of a child.

Former deputy head teacher David Sowerbutts, 68, faces one count of rape, five counts of indecent assault, one count of taking indecent photographs of a child and one count of another serious sexual offence.

Both defendants have denied all the charges.

Prosecutor Richard Newbury said O'Donnell worked as a caretaker at the school from the mid 1970s.

Sowerbutts had joined the school as a science teacher in 1975, and had been deputy head teacher from 1977 until he left in 1984.

O'Donnell had carried out sex attacks on the first complainant until she was 13 and he had later been joined by Sowerbutts, said Mr Newbury.

Mr Newbury said: "As time went by the two became more ambitious and inventive and would exact sexual punishments."

The first complainant, now in her 30s, who cannot be named for legal reasons, told the jury that she had lost consciousness during one of the attacks which were humiliating and physically painful.

"I would switch myself off and pretend it wasn't happening," she said.

She said one of the men would take photographs of her while the other had sexually assaulted her.

She said: "I felt I was being sexually assaulted as punishment. That was my feeling as a child. I felt I was being punished."

She said the assaults had become more humiliating as she grew older, and that O'Donnell and Sowerbutts would laugh at her as they carried out the attacks.

Referring to one attack she said: "I knew a bad thing was going to happen. It was a scary situation, disgusting, horrible."

She said she remembered trying to escape when O'Donnell and Sowerbutts held her captive in a room but found the door was locked.

Mr Newbury said O'Donnell began indecently assaulting the second complainant before raping her regularly.

O'Donnell was arrested in November 2001 at his home in Wetherby and Sowerbutts was arrested the following day at his home at Ambleside, Cumbria, after a police investigation into complaints made against them.

The trial continues.