Five prison inmates in South Carolina have been charged with setting up an elaborate extortion ring in which they blackmailed members of the military by posing as underage women online and collected more than half a million dollars, the authorities said Wednesday.

The inmates, who were indicted this month, used smartphones that were smuggled into prison to create profiles on social media and dating sites to lure in service members, Sherri A. Lydon, United States attorney for the District of South Carolina, said at a news conference in Columbia, S.C. Ten other people were charged with assisting the inmates in obtaining money they demanded from the service members, according to court documents.

The inmates exchanged nude photos with the service members, using photos of young women found on the internet, Ms. Lydon said. They would then pretend to be the girl’s father or another authority figure and tell the service member that their fictitious daughter was underage, she said. The inmates demanded money and said that if the service member didn’t pay, they would alert the military to the sexting, she said.

“Military members would then pay, fearful that they would lose their careers over possessing what they were led to believe was child pornography,” said Drew Goodridge, a special agent with the Naval Criminal Investigative Service. That agency had been investigating the scheme since early 2017. It called the inquiry Operation Surprise Party.