This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

Please enable Javascript to watch this video

A man has been sentenced to prison for a "sextortion" scheme that involved two teenage girls he met on the social media app Kik.

Josh Manuel Magana, 27, was sentenced to 31 years in prison for charges of rape and other sex crimes related to the sextortion of the two teenage girls, ages 16 and 17, the Los Angeles County District Attorney's office said Wednesday.

Authorities said Magana began reaching out to a 16-year-old girl on Kik, using the screen name "thegiftedmonster," in October 2016.

"He just sort of appeared out of nowhere. She didn't know him and he's messaging her on Kik, basically saying if you don't send me nude photos I'm going to kill you, I'm going to kill your family," Deputy District Attorney Michael DeRose told KTLA.

Detectives said Magana convinced the victim he knew her personal information, including where she lived and where she attended school.

The victim told her parents and reported Magana to police. He was arrested at his home in unincorporated Whittier on Feb. 7, 2017.

After serving a search warrant, detectives found additional photographs and videos of another underage girl, as well as Kik messages in which he threatened her in a similar fashion to the 16-year-old victim.

But in this case after receiving nude photos from the 17-year-old girl, Magana went a step further and threatened to distribute the photos over the internet to the girl's friends and family unless she met him in person and had sex with him, authorities said.

Out of fear of being exposed online, the 17-year-old girl went to Magana's home where he sexually assaulted her. Authorities said Magana repeatedly threatened and extorted the girl for sex over a period of time.

"A lot of people think they can just ride it out, send some nude photos and it will stop escalating. These guys don't stop," DeRose said. "You need to report it immediately, the very first time and let law enforcement try and locate these guys," DeRose added.