Shearer, a first offender, admitted taking or permitting to be taken or making indecent images of children at his home in Craigmarloch for more than a year, between November 7, 2015, and November 15, 2016.

He also admitted, between the same dates, to being in possession of indecent photographs of children.

Prosecutor Agnes Meek told the court: “On November 3, 2016, police received information that indecent images were being downloaded at a house in Cumbernauld.

“Based on the information a search warrant was granted at Airdrie Sheriff Court and at 7.40am plain clothed detectives attended at Shearer’s home.

“They were met at the door by the accused and a systematic search of the house was carried out and a Sony mobile phone and an iPad mini white were seized.

“An early examination found indecent images of young children contained on both. He was detained and taken to Coatbridge Police Office.”

Sheriff Derek O’Carroll was told that a full examination of both devices was carried out by PC Jane Wallace and DC David Brown of the Cybercrime Unit at Helen Street Police Office, Glasgow.

Ms Meek told the court that the examination found the devices to contain 5,339 still and moving images, some of the worst possible category.

The sheriff was also told that some of the pictures showed females aged eight, nine and 12-year-old carrying out sex acts on male adults.

Shearer denied a separate charge of being in possession of extreme pornographic images depicting explicit images of a woman performing sex acts on dogs. It was alleged he was in possession of the photographs between December 2, 2015 and March 14, 2016. His not guilty plea was accepted by the Crown.

Sheriff O’Carroll deferred sentence on Shearer until October 25, telling him that “all options” will be open to him, including a custodial sentence. The sheriff called for a full social background report, including a tagging order assessment.

Shearer was released on bail, with the special condition banning him from any Internet access, including on his mobile phone. He was also put on the Sex Offenders’ Register indefinitely, the exact period to be determined when sentenced.

The News & Chronicle understands Shearer is no longer living at the same address.