A former undercover NYPD detective convicted for his role in the caught-on-camera assault of an SUV driver by a pack of motorcyclists on a highway was sentenced on Wednesday to two years in jail.

Wojciech Braszczok, who was fired earlier this year upon his conviction, had acted like a gang member in search of revenge by chasing SUV driver Alexian Lien and cornering him after he ran over one of the motorcyclists, paralyzing him, state Supreme Court Justice Maxwell Wiley said.

"Just as much as anybody, Mr. Braszczok terrorized these people," the judge said.

Video footage of the 2013 pursuit and assault showed the bikers surrounding Lien's Range Rover on a Manhattan exit ramp and shattering its windows before Lien, a married father, was pulled from it and beaten. Eleven men were indicted in the confrontation.

Braszczok, 34, served as a police officer for 13 years. He did not participate in Lien's beating but faced up to seven years in state prison for his role in the events that day. Video footage showed him breaking the SUV's taillight window. He then fled but did not call 911 or attempt to stop the assault.

Braszczok was briefly handcuffed Wednesday but was released on bail after the judge granted a request to give him until a court date early next month to get his affairs in order. He declined to talk to reporters.

A prosecutor, Joshua Steinglass, had asked for a sentence of 3 1/2 years in state prison, arguing Braszczok had acted like an outlaw on his day off by joining hundreds of bikers who sped through the city violating traffic laws on Sept. 29, 2013, in a rally that resulted in 300 traffic-related emergency calls.

"That day was pandemonium," Steinglass said.

Lien, who received nearly two dozen stiches to his face after the attack, wasn't charged.

Braszczok, who worked as an undercover officer during the Occupy Wall Street protest, had testified he didn't intervene because he was scared for his safety and was worried about getting fired.

His attorney, John Arlia, had asked for a non-jail sentence that would require him to speak to law enforcement officers about better decision making.

"He is not protesting that he is culpable of certain conduct," Arlia told the judge.