An Arizona man who pleaded guilty in March to charges connected to the shooting of a New Mexico State Police officer in September 2020, was sentenced to 30 years in prison Wednesday.

Alexander Uballez, the U.S. Attorney for the District of New Mexico, announced that 31-year-old Robert Benjamin Nelson was sentenced to prison for the attempted murder of a federal task force officer and discharging a firearm during a federal crime of violence.

Nelson pleaded guilty to the charges March 22 after a mistrial Jan. 17.

US JUDGE UPHOLDS NEW MEXICO GOV. GRISHAM'S SUSPENSION ON GUN-CARRY RIGHTS IN PUBLIC PARKS, PLAYGROUNDS

Robert Benjamin Nelson mugshot

Robert Benjamin Nelson booking photo (New Mexico State Police)

"Today, bravery prevailed over cowardice and truth over irrational hate," Uballez said. "Federal law enforcement officers work every day to make our lives safer. When their lives are put at risk by someone who trained himself to fear police through fantastical internet videos, we will serve decisive justice to protect our protectors."

The Department of Justice (DOJ) said in a release that on Sept. 12, 2020, New Mexico State Police Sgt. Sharron Duran, who was working as a U.S. Homeland Security Investigations (HSI) Task Force Officer, pulled a pickup truck over being operated by Nelson, after he was seen following another vehicle too closely.

When Duran approached Nelson’s truck from the passenger side, he raised a .22-caliber pistol and shot at the officer three times through the window, the DOJ said.

NEW MEXICO POLICE OFFICER CHARGED WITH MANSLAUGHTER IN FATAL SHOOTING OF BLACK MAN AT GAS STATION

police car lights

When Duran approached Nelson’s truck from the passenger side, he raised a .22-caliber pistol and shot at the officer three times through the window, the DOJ said. (iStock)

The first shot caused the passenger window to shatter, and shards of glass struck the officer in the face and eyes.

In an effort to shield her face, Duran raised her hands, and the other two bullets hit her in the hands, causing permanent injury to one of her eyes and both hands.

She fell to the ground but immediately got back up to return fire as Nelson sped off.

CORRECTIONS OFFICER ACCUSED OF SMUGGLING DRUGS INTO NEW MEXICO JAIL

courtroom and gavel

An Arizona man who pleaded guilty to federal charges connected to the shooting of a New Mexico State Police officer working as a Homeland Security officer in 2020, was sentenced to 30 years in prison Wednesday. (iStock)

Duran then got back into her vehicle and chased after Nelson, who was traveling west on Interstate 40, before pulling him over again.

Nelson then attempted to grab a rifle from the floor of his vehicle, and Duran waited for backup officers to arrive.

He was then apprehended without further incident.

CLICK HERE TO GET THE FOX NEWS APP

"These types of shootings are brazened, violent acts, absolutely without justification and a threat to our entire community," FBI Special Agent in Charge Raul Bujanda said. "An attack on a federal Task Force Officer is a federal crime with serious consequences. Today’s sentencing reflects the FBI’s unwavering commitment to ensure that all those responsible for violence crimes against law enforcement officers are brought to justice."