PHILADELPHIA — Liam Heim — the 21-year-old charged with kidnapping a South Jersey 12-year-old and sexually assaulting her in a hotel room — fantasized about torturing her in a "sex dungeon," authorities say he told them.

Liam Heim was charged with first-degree kidnapping after he was allegedly found with the missing girl from Collinsgwood at a hotel near Philadelphia International Airport. According to statements police made in an affidavit, he traveled from from Gulfport, Florida to Collingswood to meet the girl he first encountered via an online gamer chat system called Discord.

In an affidavit supporting a federal complaint, Homeland Security Special Agent Joshua Conrad said Heim told investigators two decided to make their relationship "official" and began "dating" online, even though Heim knew it was wrong.

During arguments on Friday to keep Heim detained on federal charges, assistant U.S. Attorney Seth Schlessinger said some users in a group chat kept messages exchanged between Heim and the girl,  according to the Courier Post. The messages were turned over to police.

In those messages, Heim threatened suicide if the girl wouldn't meet him, Schlessinger said, according to the report. Another message mentioned his wish to have unprotected sex with her, and to torture her in a sex dungeon, Schlessinger reportedly said. He also said he loved the girl, and told investigators he tried to break it off but she continued to flirt online with him, Schlessinger told the court.

The pair went to Philadelphia via a PATCO train, had dinner and walked around the city before going to a hotel near the airport, authorities have said.

Once at the hotel, Heim asked the girl to keep her phone turned off and the battery removed, the Courier-Post reports Schlessinger said. The girl insisted on keeping her phone on so they could see the time, he said.

In the federal complaint, authorities say Heim told investigators the two engaged in sexual activity, but he did not penetrate her.  Under federal law oral sex is also considered illicit sexual behavior.

Schlessinger said Heim was fired from his job at a Winn-Dixie supermarket in Florida because of time missed to travel to New Jersey. He also allegedly initially lied to investigators about his address, according to the Courier-Post report.

Contact reporter Dan Alexander at Dan.Alexander@townsquaremedia.com or via Twitter @DanAlexanderNJ