A New York Police Department (NYPD) detective was charged Tuesday with accessing a restricted federal database and using an email hacking service to pry into the business of other officers.

According to a complaint (PDF) filed Monday, Edwin Vargas, 42, allegedly purchased more than $4,000 worth of illegal services between 2011 and 2012 to obtain email login credentials and cell phone numbers belonging to at least 30 individuals, including 19 current NYPD officers, a retired officer for the department and another person who worked as NYPD administrative staff. 

According to reports, Vargas was trying to spy on his ex-girlfriend, who he believed was involved with another officer. He is charged with one count of conspiracy to commit computer hacking and one count of computer hacking which, combined, carry a maximum two-year prison sentence.