A janitor at a New York City hospital tried to initiate a sexual encounter with a 14-year-old girl he met online, telling her he anticipated taking her virginity, according to prosecutors.

John Emilio, 43, entered a guilty plea to attempted endangering the welfare of a child on December 23 in exchange for spending three years in a New Jersey state prison, the Burlington County Prosecutor’s Office announced Monday.

“During the investigation, Emilio initiated contact and sent nude pictures of his genitals, said he was very excited that he would be having sex with a girl so young, and looked forward to taking her virginity,” prosecutors said in a statement.

The New York Post reported Tuesday that Emilio, who wrote on the jail intake form that he worked at Staten Island University Hospital’s north campus, was actually communicating with an undercover officer in the High Tech Crimes Unit for the Burlington County, New Jersey, prosecutor’s office.

Emilio got on officials’ radar in November 2019, when the prosecutor’s office initiated a proactive investigation into online child exploitation, the Associated Press reported.

The janitor allegedly thought he was communicating with a 14-year-old from New Jersey.

“Emilio had discussed coming to Burlington County to have sex with the girl, either at a Route 130 motel or inside of his vehicle, but the trip never materialized,” the prosecutor’s office said.

Emilio was arrested in February 2020 at his Staten Island, New York, home. As part of the plea deal, he is scheduled to receive his three-year prison sentence on March 24, according to Burlington County Prosecutor Scott Coffina.