While serving time in a South Carolina prison, several inmates created an elaborate online “sextortion ring” that preyed on hundreds of U.S. servicemembers and manipulated them into sending money and nude photos of themselves, according to federal prosecutors.

The scheme was uncovered after a nearly two-year investigation, called “Operation Surprise Party,” launched by U.S. Naval Criminal Investigative Service and aided by other government partners.

In five separate indictments, prosecutors allege that the male prisoners used contraband cellphones to extort members of the Army, Navy, Air Force and Marine Corps through online dating websites by posing as young women. The online scheme bamboozled 442 troops out of more than $560,000, prosecutors say.

“With nothing more than smart phones and a few keystrokes, South Carolina inmates along with outside accomplices victimized hundreds of people,” Daniel Andrews, Director of the Computer Crime Investigative Unit of the U.S. Army Criminal Investigation Command, said in a statement.

The prisoners — some of whom are in prison for armed robbery, kidnapping and murder — had help from 10 people outside the prison to help smuggle in cellphones and carry out the scheme.

The prisoners developed fake personas as 18 or 19 year-old women on social media forums and online dating websites. They would then try to pursue online romantic relationships with U.S. servicemembers.

After developing the “relationship” on the websites, the prisoners began texting nude photographs of young women that they were impersonating. In fact, the photos were simply obtained from the Internet.

Once they texted the pictures, the prisoners asked the military members for nude photos or other personal information in return. When the solider responded with their nude photos, the prisoners would then assume a role of the woman’s father, who claimed his daughter was a juvenile. He would demand money, on behalf of the family, in exchange for not pursuing criminal charges.

Fearful that they might lose their military careers over possessing what they assumed was child pornography, the soldier would wire money through Western Union, MoneyGram, PayPal or Walmart.

People outside the prison would obtain the funds and deposit it in either a Department of Corrections account or would establish a prepaid debit card that could be accessed via smartphone.

“There are more than 250 additional people who are being investigated and face potential future prosecution,” Naval Criminal Investigative Service said in a statement.

The victims are stationed at bases across the country and prosecutors urge all service members targeted by sextortion to contact their branch’s military investigations office.

Get our Politics Newsletter. The headlines out of Washington never seem to slow. Subscribe to The D.C. Brief to make sense of what matters most. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to W.J. Hennigan at william.hennigan@time.com.