A SENIOR teacher has admitted amassing a library of more than 22,000 child porn and beastiality images while running the computing department of a high school.

Roger Moult was a respected principal teacher of computing at Arbroath Academy as well as being the chairman of a church organisation.

But behind closed doors and over a period of almost 10 years he downloaded 22,492 indecent images of children, as well as amassing a collection of 54 child porn videos and a stash of "extreme porn" images showing women having sex with dogs and horses.

He was sentenced yesterday a three-year community payback order and will also be placed on the sex offenders' register.

Dundee Sheriff Court heard that police were tipped off about Moult's child porn habit when his credit card information was flagged up buying DVDs from a Canadian website.

It claimed to offer "naturist" videos - but in fact supplied DVDs of naked "pre-teen" children.

Fiscal depute Kirsten Thomson told the court that police then raided his home on March 6 last year.

They discovered porn - adult and child - in every room and had to call in a specialist search team because rubbish was "strewn everywhere" in the house in Montrose's High Street.

Miss Thomson said: "The house was found to be extremely untidy and there was a large amount of pornographic material - magazines, DVDs and videos in every room.

"A total of 25 computer devices were seized and evidential material was found on each of those.

"A total of 22,492 images were recovered with 22,450 of those being at level one on the scale, depicting erotic posing."

The prosecutor said a handful of the images were at the top level of the scale - while a total of 35 beastiality images and 17 extreme videos were found on his system.

Moult, 64, of High Street, Montrose, pleaded guilty on indictment to two charges of possessing child porn and extreme pornographic material.

The offences took place between January 8, 2005 and March 5, 2014.

Defence solicitor Nick Markowski said Moult had retired from his position at Arbroath Academy in January 2012.

He said: "His career was without any difficulty whatsoever - he's managed to keep separate his public life from his private difficulties.

"He's asked me to publicly apologise and knows he was wrong."

Sheriff Alastair Brown imposed a three year community payback order with supervision and ordered him to take in a sex offenders group work programme.

The sheriff said: "Whilst accessing this material you put boundaries in place so that although you had as a teacher easy access to children there's no reason to suppose that you ever abused that trust.

"There's no reason to suppose you were anything other than exemplary in your conduct towards children whether at school or in other contexts."

Angus Council confirmed the former department head had not worked for the local authority since March 2012.

Vice-convener of children and learning Lynne Devine also expressed confidence that local authority procedures are in place to prevent anyone accessing indecent images or video in schools.

She added: "I am very confident the systems are in place to prevent that."