Gareth Williams' fate was sealed when he made the fatal decision to buy child pornography from a company based in Canada.
Two months before his arrest in January this year, Toronto Police revealed that since October 2010 they had been leading an international investigation known as Operation Spade that covered more than 50 countries.
The inquiry focused on a firm based in the city called Azov Films which began distributing DVDs and streaming videos of naked children it marketed as "naturist" in 2005.
In May 2011 the home and office of Brian Way, the firm's owner, were raided, and he was arrested.
Police allege he instructed people around the world to create the videos of children ranging from five to 12 years of age.
They included naked boys from Germany, Romania and Ukraine.
Toronto law enforcement authorities and the U.S. Postal Inspection Service recreated Way's customer records and shared them with the Royal Canadian Mounted Police and Interpol. Investigations involved more than 50 countries. Way is alleged to have earned more than $4m from his website.
Inspector Joanna Beaven-Desjardins, of the Canadian police force's Sex Crimes Unit said: "It's a first for the magnitude of the victims saved," and "The amount of arrests internationally, also a first."
Referring to material seized from Brian Way's home, she said: "Officers located hundreds of thousands of images and videos detailing horrific sexual acts against very young children, some of the worst that they have ever viewed."
Altogether, Toronto Police said 386 children around the world had been rescued, with 348 people arrested, among them 40 schoolteachers, nine doctors and nurses, nine clergymen, six police officers, three foster parents and more than 40 people who volunteered with children.
At that time, however, none of the arrests had taken place in Britain, even though information concerning hundreds of British purchasers of the material had been passed to the UK's Child Exploitation and Online Protection Centre (CEOP) in April 2012.
The National Crime Agency, which now oversees CEOP, has confirmed that an independent review is under way, looking into why a significant delay occurred in acting on the intelligence.
Williams was one of the Azov customers whose details were passed over to CEOP.
When South Wales Police raided his home in Rhiwbina, Cardiff in January, he handed over evidence that showed he had not only been buying child pornography, but rigging up secret pinhead cameras in homes and at the school where he was the deputy head in order to spy on children going to the toilet.
His arrest caused utter shock among the staff, parents and pupils of Ysgol Glantaf in Cardiff, the largest Welsh medium school in Wales which opened in 1978 and whose former pupils include actors Ioan Gruffudd and Matthew Rhys, former Labour MEP Baroness Eluned Morgan of Ely, Ffion Hague, the wife of Foreign Secretary William Hague, former Blue Peter presenter Gethin Jones and Wales rugby star Jamie Roberts.
Williams had been a popular maths teacher who impressed parents who came into contact with him in his capacity as deputy head.
One parent said: "Last year he headed up a welcoming event for parents whose children were about to join the school. He appeared very professional and approachable and instilled confidence at a time when children were about to go through the potential upheaval of making the transition from primary to secondary school."
Yet for many parents shock turned to anger when it became known that he was being investigated for, and subsequently admitted, rigging up a secret camera in the boys' toilets to spy on them.
One parent said: "It is difficult to think of a worse breach of trust. He took advantage of his position at the school to spy for sexual purposes on the children he was responsible for. The extent to which he was prepared to go shows he is a determined and cunning paedophile."
A teacher at the school said: "We've been advised not to say anything about this, but I would never have expected that of him."
Since his arrest in January Williams has been held on remand in Parc Prison, Bridgend, and suspended on full pay. Now that the court proceedings have been completed, disciplinary proceedings that will inevitably result in dismissal will proceed.