A former council boss who had more than 5,000 indecent images of children on his computer has avoided jail.

Lawyer Andrew Laycock, the former head of legal services at Hertfordshire County Council, admitted downloading the images, mostly of girls between the ages of ten and 14.

Yesterday (Tuesday) the 59-year-old avoided a jail term and was instead given a 26 week sentence at St Albans Crown Court, suspended for two years.

Laycock, who has been attending counselling courses to tackle his perversion, confessed his dark secret when interviewed by police officers. He said he had contacted other adults on internet chat rooms and talked about having sex with children.

Prosecutor Peter Shaw told the court that police armed with a search warrant raided the home Laycock shared with his wife and two stepsons in Hertford at 6.45am on June 22 last year.

Laycock, who had answered the door, said he alone was responsible for the images.

His Apple computer was analysed and found to contain 5,720 images, 79 of which were classified as level 5 – the most serious images it is possible to produce.

Laycock, of Mandeville Road, Hertford, had pleaded guilty at an earlier hearing to 17 counts of making indecent images of children and one count of possessing more than 5,700 indecent images during June last year. He was supported by his wife in the public gallery as his sentence was read out.

Dee Connolly, defending, said Laycock had taken up the police advice at the time of his interview and attended courses at the Lucy Faithful Foundation that aims to rid people of their addiction to child sex abuse images.

She said: "He was extremely full and frank in his admissions and took the offer to get help. He is deeply ashamed of his behaviour."

Judge Andrew Bright QC told him: "You built your reputation up as a lawyer and have rightly lost it as a result of what you were secretly doing."

The judge gave him credit for his guilty plea and passed a 26 week jail sentence suspended for two years.

He was also handed a two year supervision order and told to attend an internet sex offenders’ treatment programme. He must register as a sex offender for seven years.