NEW YORK -- A former New York City police officer entered a guilty plea Monday in a widespread ticket-fixing case that landed 21 people in handcuffs, and implicated hundreds of others.

All but one of the 181 counts Brian McGuckin faced -- including grand larceny, forgery, official misconduct, conspiracy and criminal solicitation -- were dropped as part of a plea deal with the Bronx District Attorney's office. He admitted guilt on one count of Grand Larceny in the 4th Degree.

Bronx judge Steven Barrett granted McGuckin, a former New York City police union delegate and financial secretary, a conditional discharge, under which McGuckin will serve no jail time as long as he stays out of trouble for the next three years. Prosecutors had asked Barrett to sentence McGuckin to 1,500 hours of community service.

Get Breaking News Delivered to Your Inbox

McGuckin, who retired yesterday, will also lose part of his pension, which he would have received in full had he made it through July 30, his 20th anniversary with the New York Police Department, according to the Bronx District Attorney's Office.

The investigation that led to charges against McGuckin and others began with a wiretap in 2008 of disgraced former New York City cop Jose Ramos, who was convicted in 2014 of trafficking drugs out of two barbershops he owned in the Bronx, and in 2015 of conspiring to kill a witness.

While following Ramos, New York Police Department Internal Affairs investigators stumbled on an intricate favor system that allegedly allowed cops from throughout the Bronx to suppress summonses for themselves, their friends and family.

Detectives intercepted more than 450,000 text messages, phone calls and emails during the nearly two-year investigation that ended with charges against 16 cops, including McGuckin, and five others.

In October 2014, New York City Lt. Jennara Cobb became the first of those charged to be convicted. Cobb was found guilty of divulging an eavesdropping warrant, official misconduct and obstruction of governmental administration. She was sentenced to 200 hours of community service.

The next trial in the case, for officer Christopher Manzi, is set to begin in June.