A police officer who raped a toddler has been jailed along with a Welsh Government lawyer for his part in child sex abuse.
South Wales Police officer Dean Roberts got 12 years after admitting one count of rape and five indecent assaults.
Lawyer John Ryan-Guess was handed 20 years for 37 charges, including sexual assault and making indecent images.
Cardiff Crown Court heard Ryan-Guess, 43, also admitted aiding and abetting Roberts to commit sexual assault.
The pair had met on an online chat forum called Kik.
Prosecutor James Wilson said Ryan-Guess also filmed young girls in public, including at a supermarket and a swimming pool.
After police found videos on his phone of him carrying out sexual assaults on children, he told officers he had been interested in young girls all his life and found them arousing.
Ryan-Guess, who no longer works for the Welsh Government, found out about the Kik online messenger service where he shared thousands of images, as well as one live stream of him abusing a child.
He said he felt Kik "normalised" his behaviour because he could chat to and share material with like-minded people.
Recorder of Cardiff Eleri Rees called him a "sexual predator" who took "any opportunity" to offend.
She said his offences escalated from voyeurism to touching and "it would have been a matter of time" before he raped a child had he not been caught.
In a victim impact statement, the mother of one of his victims said she felt "tormented" by the knowledge he had preyed on her daughter.
She said her daughter was having therapy to try and come to terms with what happened.
Roberts, 48, from Bridgend, who was a serving police officer when caught, also admitted possessing and distributing indecent material of his assaults.
The court heard Ryan-Guess and Roberts discussed abusing a girl and indecent images of her were shared on the site.
Roberts and Ryan-Guess also met for what was described as a "sexual encounter".
The judge told Roberts: "You are dangerous and pose a significant risk."
South Wales Police Det Supt Wendy Gunney said: "The two people responsible for the appalling abuse of a number of very young children have now been brought to justice.
"The investigation uncovered extremely disturbing child abuse evidence and the guilty pleas have ensured that the jury were spared from viewing evidence that would have been extremely traumatic."
The NSPCC has called for "tough measures" to make social media companies do more to protect children online.
A spokesman added: "Abusers increasingly use the internet not only to target and groom their young victims, but to communicate with each other.
"This case shows again how sickening child abuse footage is often shared within groups of like-minded offenders."