A kidnapped 17-year-old Rialto girl was reunited with her family after being held against her will by a man in New York, police said Thursday.

The girl’s family first called the Rialto Police Department on April 30, saying they were concerned after finding out that their missing teenager had been chatting with a man online.

Two days went by and the girl did not return home, so a detective from the Police Department began searching for her.

After finding phone number with a New York City area code they suspected was tied to the man who was speaking to the missing girl online, the detective called the number and sent a text message asking the phone’s owner to call her. 

“Suspecting the juvenile victim could be in danger, Detective Watson relentlessly pursued her attempts to locate the female through various resources,” police said in a news release.

A few days later on May 5, the detective got a reply from the number. It was from the missing girl, according to the department.

In the text message, the girl said she needed help because the man, later identified as 24-year-old Elijah Clark, was refusing to let her to leave, and she wanted to return home. 

The Rialto police detective reached out to the New York Police Department. Officers there went to Clark’s home but didn’t find the girl. 

“The following day, at the request of Detective Watson who was convinced the female victim was being held against her will, requested New York Police Department officers to attempt to make contact at the residence once more,” Rialto police said.

New York officers went to the home again and were able to rescue the missing girl. On Tuesday night, she was returned to her home in Rialto and reunited with her parents. 

Clark was taken into custody on suspicion of kidnapping, false imprisonment, injury to a minor, strangulation, assault on a police officer, and multiple weapons charges, authorities said.

In addition to the criminal charges he faces in New York, Rialto police recommended several additional criminal counts, including kidnapping, contact with a minor with intent for lewd acts, and meeting with a minor for lewd purposes.