Brick, New Jersey police Officer Justin Delaney is accused of stalking his girlfriend through cellphone and social media communications. (Credit: Ocean County Prosecutor's office)

BRICK, N.J. (CBSNewYork) — A Brick, New Jersey police officer was indicted this week, on charges that he harassed and stalked his former girlfriend by phone, text and social media.

Brick Township Officer Justin A. Delaney, 33, was charged in a two-count indictment with official misconduct and stalking, according to the Ocean County Prosecutor’s office. The indictment against Delaney was returned by a grand jury on Wednesday.

As of Friday, Delaney was out of jail on $30,000 bond.

The indictment claimed that between November 2012 and May 2013, Delaney used Facebook, Instagram and other social media platforms to harass and humiliate his ex-girlfriend, prosecutors said. Investigators traced the social media accounts to IP addresses registered to Delaney, prosecutors said.

Delaney was also accused of using a prepaid cellphone to harass his ex-girlfriend in phone calls and text messages, prosecutors said.

The indictment claimed further that Delaney used a password he obtained through official work as a police officer to hack into a law enforcement investigative database, prosecutors said. Delaney allegedly used the database after his ex-girlfriend asked him who was harassing her – when in fact, prosecutors alleged, it was Delaney himself.

Delaney allegedly created the impression that the cellphone used for the harassing messages was untraceable, prosecutors said.

If convicted, Delaney could face a maximum sentence of 10 years in prison on the official misconduct charge, and up to 18 months in prison on the stalking charge, prosecutors said.