A paedophile downloaded more than 10,000 child abuse images and videos, including babies being tortured, by using a library's Wi-Fi.

William Cox was caught with the huge cache of pictures, which included more than 2000 at the most serious level, which he had downloaded in little over two months last year.

The unemployed criminal's flat in Dundee was raided last June after police were tipped off.

Cox told police he did not have his own internet connection at his home in Craigowan Road but instead used the nearby Charleston Library's signal to access the internet.

Fiscal depute Eilidh Robertson told Dundee Sheriff Court the images depicted both boys and girls aged between a few months and 15 years old.

She said: "In total, 9226 indecent images and 1471 indecent videos of children were recovered across all devices.

"Of those, 1454 images and 754 videos were category A, 1277 images and 401 videos were category B and 6495 images and 316 videos were category C.

Cox, 59, pleaded guilty on indictment to charges of downloading and possessing indecent images of children between April and June last year.

Mike Short, defending, said: "Given the nature of the charges there's clearly an ongoing problem for him."

Sheriff Lorna Drummond QC deferred sentence until next month for social work background reports and released Cox on bail, putting him on the sex offenders register in the meantime.

She said: "The guidelines suggest this is the kind of case where he might go to jail. It is a serious matter."