A former Southern California man who convinced troubled girls as young as 12 to perform masochistic acts and urged one to become his sex slave pleaded guilty Monday to a federal charge, prosecutors said.

Matthew Christian Locher, 31, pleaded guilty to one count of sexual exploitation of a child for the purpose of producing a sexually explicit visual depiction, the U.S. attorney's office said in a statement.

AT LEAST 181 K-12 EDUCATORS CHARGED WITH CHILD SEX CRIMES IN FIRST HALF OF 2022

In his plea agreement, prosecutors said Locher acknowledged that while living in Redondo Beach in 2020 and 2021, Locher got into online conversations targeting girls suffering from mental health issues such as depression, anorexia and suicidal thoughts.

A 31-year-old man pleaded guilty to sexually exploiting children in California.

An ex-Californian admitted to grooming young girls suffering from mental health issues, such as depression and eating disorders. He encouraged them to harm themselves, burn down their house, kill their parents and run away. (Fox News)

"Locher groomed his victims to engage in self-mutilation and instructed a victim struggling with an eating disorder to starve herself, ordering her to film herself cutting her body when she disobeyed him," the U.S. attorney's office statement said.

Two girls sent him images of self-harm, prosecutors said.

He convinced a third victim, who was 12, to run away from her Ohio home and attempt to reach California to have sex with him, prosecutors alleged.

MILITARY VETERAN ADMITS TO FAKING OWN DEATH TO ESCAPE CHARGES OF RAPING, IMPREGNATING 14-YEAR-OLD STEPDAUGHTER

Encouraged by Locher, the girl first set fire to her home in a failed bid to kill her parents, prosecutors alleged.

Locher had promised he would pick her up, "bring her to California, and make her his ‘slave,' " the U.S. attorney's office said.

Locher moved to Indiana after authorities searched his home. He was arrested on Jan. 10 of this year in Indianapolis and sent back to California, authorities said.

Locher faces 15 years to 30 years in prison when he is sentenced next January.