The IT manager of a school in Carmarthenshire has been jailed for two years after being found guilty of possessing nearly 400,000 indecent images of children.
Jeffrey Gravell had denied the charges when he appeared at Swansea Crown Court in January.
Police arrested the 54 year old after the images were found on computers he had taken home from the school where he worked in Llanelli.
Gravell stole a "huge amount" of laptops, PCs, printers and other computer gear from the high school where he was in charge of IT equipment for 10 years. A court heard police needed four transit vans to take it all away for examination - and were horrified by the material.
Prosecutor Jim Davies said: "He hoarded it rather like a magpie. He had a vast library of indecent images of children - over 300,000 images and movies were catalogued. It was so much that when the police officers got to 391,270 images they stopped counting."
Married Gravell used the school computers to download and store his haul of indecent images including 715 at level five, the most serious category of pornography.
Gravell claimed he had no knowledge of the pictures - saying they must have been downloaded during routine backing-up of the school's networks. And he claimed the computer equipment found at his home in Llanelli, South Wales, was being kept for spares and repairs, enabling him to work at home.
Gravell was found guilty of 43 counts of making and possessing indecent images. He was also convicted of stealing thousands of pounds worth of computer equipment, from Coed Cae School in Llanelli, South Wales.
Robin Rouch, defending, said: "His reputation is now in tatters - his chances of employment after his release are highly unlikely."
Judge Christopher Vosper QC told him: "This was an enormous number of indecent images, the most that Dyfed Powys Police have ever encountered."
Gravell was ordered to register as a sex offender for 10 years and banned from working with children indefinitely.