DALLAS — The suspect in the fatal shooting of a Texas state trooper during a traffic stop on Thanksgiving Day had previously beaten a deputy and tried to take his gun, but had the charges dismissed or reduced to a misdemeanor in a plea deal.

Police camera footage obtained by WFAA-TV from the 2015 incident in Smith County, about 95 miles east of Dallas, shows Dabrett Black beating a sheriff’s deputy. The deputy, identified as Wesley Dean in court documents, no longer works at the department. The court documents say he suffered black eyes, a broken nose and lacerations above his eyes that required stitches to close. The footage also shows him talking to the in-car camera saying to imagine if he had had a weapon and talking about his belief that law enforcement officers target minorities.

A plea agreement filed in March 2016 shows a Smith County prosecutor recommended a one-year jail sentence on a misdemeanor charge in lieu of the two felony charges of assault against a public servant and trying to take an officer’s weapon. A spokesman for the district attorney’s office told WFAA that the deputy prosecutor who worked on the plea deal did not ask for permission from District Attorney Matt Bingham or his top assistant when the recommendation for reduced charges was made, which is a violation of the office’s policy.

It was unclear from court records whether Black had an attorney as of Wednesday.

The district attorney’s office did not immediately return a phone message from The Associated Press seeking additional comment.

An arrest warrant in Thursday’s fatal shooting of Texas Trooper Damon Allen said Allen initiated the traffic stop and after getting Black’s driver’s license and information went back to his patrol unit. The filing said troopers believe Allen had gotten back in his car when police allege Black stepped out of his vehicle, took out a rifle and began shooting at the patrol car.

The affidavit said Allen died on scene from at least one gunshot wound and that his gun was holstered. It said he appeared to try to exit the vehicle and Black’s license was found under his body.

Black was being held by the Freestone County Sheriff’s Office in the nearby Limestone County jail on a charge of capital murder of a police officer. A judge has denied setting bond on that charge.

When the shooting occurred, Black was free on $15,500 bail in another Smith County incident where he was charged with assault on an officer and evading arrest after a police chase this summer ended with Black allegedly ramming a patrol car.

Probation officers had told staff to be careful of Black in internal emails after the 2015 attack, according to the material obtained by WFAA. In a July 2015 email, a probation officer told staff he believed Black was trying to provoke them into responding and encouraged them to be vigilant both inside and outside the office because he believed Black was the kind of guy who would ambush someone.