Updated

A New York man confessed to cyberstalking his ex-girlfriend, posting her personal information on a prostitution site and mailing her drugs at college in an attempt to get her arrested.

Thomas Traficante, 23, of Seaford, pleaded guilty Thursday to “cyberstalking and distribution of a controlled substance” in federal court, Newsday reported. He could face up to 37 months in prison under a plea agreement and is slated to be sentenced later this year.

Traficante, a student at St. John’s University in Queens, met his former girlfriend, a SUNY Geneseo student who was not identified, through an online dating website. The two broke up on Oct. 26.

But then the spurned lover started sending his ex-girlfriend and her sorority sisters cryptic text messages telling them “it’s not safe out there tonight” and “there are various people among different orgs who have me. My plan is to hurt them,” prosecutors said.

MAN SUCKER PUNCHES 5-YEAR-OLD IN FACE ON NEW YORK CITY SUBWAY: COPS

One time, Traficante reportedly used a device to alter his voice, telling the woman’s roommates “I’m in the house.” The woman changed her cell phone number but Traficante was able to find the new one and threaten her further, prosecutors said.

In November, Traficante mailed the woman drugs, including cocaine and methamphetamines, to her college mailbox. He then notified police about the drugs in order to set up the woman and get her into legal trouble.

Newsday reported the woman’s room was searched but nothing was found. The victim told officers her ex-boyfriend was “controlling.” She also showed officers texts from Traficante in which he threatened to share her personal information on a prostitution site if “she did something he strongly disagreed with.”

The Democrat & Chronicle reported Traficante posted the woman’s information on Backpage.com, under a prostitution category, and she received some 60 calls from men asking for sex. She also said her former boyfriend hacked into her Amazon account and sent her a book titled “I’m Watching You.” He also allegedly hacked into her email, cellphone and social media accounts. The woman also claimed Traficante gained access to her school account and took quizzes under her name, purposely getting her a failing grade.

DRUNK MAN STEALS BEEF JERKY FROM 7-ELEVEN, BREAKS INTO NEW YORK HOME AND URINATES ON PORCH, COPS SAY

Traficante was also accused of shooting at the victim’s parents' home with a BB gun. When police arrested him at his mother’s home in December, a loaded AR-15 rifle was found. It was not immediately clear if Traficante had purchased the gun legally.

This is not the first time Traficante has been accused of stalking. From 2014 to 2015, another woman claimed she was cyberstalked by Traficante, but he was not charged in that case.

“The investigation identified another victim who Traficante also subjected to similar digital harassment in 2014-2015 prior to harassing the (SUNY Geneseo) victim," the plea agreement stated.