The FBI successfully nabbed a California who had been terrorizing and harassing young girls on Facebook for years, thanks to the social network. A new report claims that the company had paid a security firm to develop the hack that authorities used to bring the suspect down.

Buster Hernandez or "Brian Kil," pleaded guilty to the charges, according to a report by Motherboard. He had been preying on minors on Facebook, threatening to hurt them if they didn't give in to his extortions.

The report said that Facebook had paid six figures for the hacking tool that could bypass the privacy-focused Tails OS. The tool exploited a flaw in the Tails' video player and exposed the real IP address of the person viewing the video. The social networking company then gave the hacking program to an intermediary who forwarded it to the FBI, which had sent a booby-trapped video to Hernandez, leading to his downfall.

Hernandez being apprehended somehow brings justice to his victims, but what Facebook did raises ethical questions -- is Facebook allowed to buy an exploit to hack its own user? The report also noted that the hack transpired on Tails and not on Facebook and that Tails wasn't even informed of the exploit.

Motherboard says it's unclear if the Feds were aware that Facebook was involved in the whole process. This is supposedly the only time Facebook has helped law enforcement hack a user, and a spokesperson told the publication that the company doesn't want this to set a precedent. The social networking site seems to have justified what it did by bringing Hernandez to justice.

"The only acceptable outcome to us was Buster Hernandez facing accountability for his abuse of young girls," a Facebook spokesperson told Motherboard. "This was a unique case because he was using such sophisticated methods to hide his identity, that we took the extraordinary steps of working with security experts to help the FBI bring him to justice."

Tails have been unfortunately taken advantage of by criminals, but its focus on giving users privacy has helped a lot of people for the good, such as victims of domestic violence, and people voicing their rights like journalists, activists, whistle-blowers, and government officials.

It's worth noting, however, that the exploit can be easily used by Facebook against anyone, criminal or not. Catching Hernandez was a good thing, but the incident does raise ethical questions.

The FBI declined to comment.