A former teacher who filmed dozens of pupils using hidden cameras set up at a boarding school has been jailed for more than three years.
Jonathan Thomson-Glover, 53, who taught at Clifton College in Bristol, admitted 36 counts of making, taking and possessing indecent images of children.
Taunton Crown Court heard 130 victims were filmed by secret cameras at the school and an address in Cornwall over a 16-year period.
Thomson-Glover recorded more than 2,500 hours of footage to spy on pupils aged around 12 to 17 as they engaged in sexual activity and used the bathroom.
He was caught after the National Crime Agency (NCA) traced an IP address used for downloading indecent images of children to one of his four computers.
Police then discovered footage of pupils on his computers, as well as 330 VHS tapes and a number of Hi-8 tapes found at three addresses relating to him.
There is no suggestion Thomson-Glover, who described his filming as "a compulsion fuelled by the internet", shared his footage or made physical contact with pupils.
Judge David Ticehurst jailed the teacher, who bowed his head throughout proceedings, for three years and nine months.
"This activity took place while you were a highly respected and trusted teacher at a school in Bristol," the judge said.
"You set up concealed cameras so as to enable you to watch and record the intimate and private acts of young boys and girls.
"Time, money and effort would have been spent by you in setting up these cameras and recording devices.
"The planning would have to have been meticulous - extreme care would have been taken by you to avoid the risk of detection."
Thomson-Glover was first arrested at his parents' house in Cullompton, Devon, in August 2014, following the NCA investigation.
Searches were carried out at the home, the address in Cornwall and his term-time address at Clifton College.
Hundreds of VHS tapes were seized, as well as laptops, hard drives and discs, leading to officers discovering footage taken from covert cameras.
This footage, lasting 104 days, matched 10 scenes across Clifton College and the Cornwall address - with marks found where cameras had been installed.
Thomson-Glover admitted 27 charges of taking an indecent image of a child; seven charges of making an indecent image of a child and two charges of possessing indecent images of children.
"You are a man looking at a life that is now in ruins," the judge said. "That life was a good life and you have made a positive contribution.
"It is a life now reduced to rubble as a result of your fatal flaw.
"It is impossible to calculate the harm and damage you may have caused to those who trusted you or were in your care."
Thomson-Glover was ordered to sign the Sex Offenders' Register indefinitely and banned from working with children.
Prosecuting, Howard Phillips read victim impact statements from seven pupils and three parents.
One said: "I feel a great deal of shock and sadness, and the consequences of this abuse will stay with me for a long time."
Another added: "I also worry that my parents will feel guilty, for sending their little girl into this situation."
Mr Phillips said pupils described Thomson-Glover, who allowed them to smoke, drink and have sexual relationships on school premises, as "more a friend than a teacher".
"The parents regarded him as the consummate professional, he appeared very caring, achieved good exam results and went above and beyond," Mr Phillips added. "But the reality was somewhat different."
The court heard Thomson-Glover met parents of the school following his arrest, with some writing letters of recommendation to the judge on his behalf.
One mother wrote: "I met a man who was deeply sorry and contrite."
Andrew Langdon QC, representing Thomson-Glover, said his client had realised he was gay as a teenager but repressed his sexuality.
He later began working at Clifton College and installed the cameras after viewing images on the internet.
"He had a secret addiction," Mr Langdon said. "It is too simplistic to say that the good he has done was merely in aid of facilitating the bad."
He said the majority of footage recorded was never watched, with pupils filmed engaging in sexual acts aged 16 or 17 at the time.
Speaking after the case, Detective Inspector Andrea Kingdon, of Devon and Cornwall Police, said: "These crimes amounted to an abhorrent abuse of trust and a gross invasion of privacy.
"It's clear he has been prolific in his criminal activity and has demonstrated a meticulous approach in his planning and cataloguing processes.
"Although the footage was recorded onto VHS tapes, there is a clear suggestion he may have used pinhole or spy cameras during the later stages of his offending.
"He's proved himself to be a manipulative and devious sexual offender who had the ability to keep his compulsion a secret from everyone around him."
Mr Phillips added that the case was "unique" due to the timespan of the offences, number of victims and the "gross breach of trust and invasion of privacy".
A spokeswoman for Clifton College said the discovery of Thomson-Glover's activity had been "profoundly disturbing".
"We have been shocked and appalled by the findings, which amount to an unforgivable breach of the trust placed in him by our community," she said.
"The College has taken considerable steps to ensure, so far as it is possible to do so, that nothing like this can ever happen again."
She said a series of reviews, including an external safeguarding review, had been carried out as well as physical searches of college buildings but no cameras had been found.
"These revelations have shocked us all and we are determined that if there are any further lessons to be learned, we will learn them," the spokeswoman added.