A school head downloaded child pornography from the Internet, a court heard.

Bob Shepherd admitted tapping in to gay porn sites as a "cry for help", but denied the people in the images were children. Shepherd, married with four children, said he was still trying to come to terms with being sexually abused and raped as a teenager, and was under great strain at school at the time of the incidents.

Computer consultant Brian Underhill said Internet search words entered on the computers included "gay teen", "naked boys" and "rent boy" leading to sites such as "boys 4 men".

Horsham magistrates were shown pictures of sexually explicit material accessed by Shepherd, who was suspended last year as head of Holy Trinity Church of England Primary School, Cuckfield.

Shepherd, 52, of Whitemans Green, Cuckfield, denies possessing indecent photos of children on a computer at his home last April and two allegations of misusing a computer at the school three months earlier.

In an interview with police, read to the court, Shepherd said he was sexually abused by older boys when a youngster and raped at the age of 18. He said he had been under great pressure at school for some time, including an Ofsted inspection, complaints about bullying, "stroppy" governors, long hours and a stabbing incident.

Shepherd told police he heard "through the grapevine" about gay porn on the Internet and started to access it. But he added: "In many respects, I suppose I was hoping I would get caught. I fully accept it was foolish."

Wearing a suit and striped tie in the witness box, Shepherd said the "models" in the pictures were described on the Internet as "18-plus" and "barely legal". He told the court: "I was not searching, and neither did I find, any images of males under 18.

"As far as I know, and I may be wrong, it isn't against the law to access gay sites. Yes, it's inappropriate and I don't think County Hall would like it, but is it against the law?"

John Marsden-Lynch, prosecuting, said after 30 years of teaching in primary schools, Shepherd could tell what age the children were.

He added: "I am suggesting you were closing your eyes to what was blatantly obvious, that these pictures were pictures of children." Pediatrician Dr Patricia Atkinson said some of the people in the pictures were clearly under 16 and "in the early stages of puberty".

The case moves to Mid Sussex Magistrates' Court, Haywards Heath, today.

Converted for the new archive on 30 June 2000. Some images and formatting may have been lost in the conversion.