A paedophile has been spared jail after a judge claimed a series of mistakes from the police and prosecutors have allowed him to walk free.
David Andrews, 65, pleaded guilty to possession of more than 13,000 indecent images of children, including almost 4,000 showing children being sexually abused.
Andrews, who also admitted having extreme pornography featuring sex with animals, was handed a two-year prison sentence suspended for two years.
Judge Robert Linford said he would have gone to jail if he had been quickly investigated and convicted of distributing indecent images of children.
Delivering his sentence at Plymouth Crown Court, the judge said the Crown Prosecution Service had not charged him correctly with the more serious crime of distributing indecent images, despite his apparent admission in interview.
The maximum custodial sentence for possessing and distributing indecent images of children is five years.
Judge Linford told Andrews: "You have not got me to thank for the fact that you are not serving a sentence of imprisonment but the prosecution and the police."
Two police agencies, two forensic bodies and the CPS were involved in the investigation and the prosecution.
Judge Linford asked Devon and Cornwall Police and the CPS to provide formal explanations for the way the case was handled.
South West Forensics, which normally examines indecent images, said it was inundated with a large volume of work.
A spokesman for the CPS said it was looking into the courts request.