A Bosnian citizen who assaulted several New York City police officers in 2020 has been sentenced in federal court to 30 years in prison.

U.S. District Judge Rachel P. Kovner sentenced Dzenan Camovic on Wednesday after prosecutors argued he stabbed an NYPD officer in the neck, robbed them of their firearm, then used the weapon to fire on other officers.

Camovic was inspired by terrorism and repeatedly shouted "Allahu Akbar" during the attack, the Department of Justice said. The migrant will be deported after completing his sentence.

"Today’s 30-year sentence, along with Camovic’s removal from the United States, guarantees the community will be protected from his hate-filled ideology and actions," said Breon Peace, United States Attorney for the Eastern District of New York.  "We will never stop working to protect the safety of our brave law enforcement officers and community from those who would do them harm."

ILLEGAL IMMIGRANT CHARGED IN JUNE KNIFE ATTACK THAT WOUNDED MULTIPLE NYPD OFFICERS

FBI Assistant Director-in-Charge Michael J. Driscoll said the sentence sends a message to "anyone" who intends to carry out a hate-based attack, especially on the men and women who serve in law enforcement.

"As today's sentence demonstrates, those who direct hate-fueled violence at anyone - including the brave men and women of law enforcement - will face stiff consequences in our criminal justice system.  Along with our partners on the Joint Terrorism Task Force, we remain steadfast in our determination to protect our city and our Nation from terrorists and their violent extremist ideology," he said.

In another statement, NYPD Commissioner Keechant Sewell said such attack on men and women in uniform "will never be tolerated."

"An attack against New York City police officers is an attack against our city and way of life – and today’s sentencing of Dzenan Camovic sends a clear message that such violence will never be tolerated," she said.

Sewell added: "Our NYPD family is thankful our brave officers survived this premeditated ambush. I commend our NYPD investigators, our partners in the FBI’s New York Joint Terrorism Task Force, and the prosecutors in the United States Attorney’s Office in the Eastern District of New York, for their work in this case. Together, we will never stop working to protect our city."

2 NYPD COPS SHOT, ANOTHER STABBED DURING 'UNPROVOKED' ATTACK

A photo of Brooklyn District Attorney Eric Gonzalez

Brooklyn District Attorney Eric Gonzalez speaks during press conference in the District Attorney office.  (Lev Radin/Pacific Press/LightRocket via Getty Images)

Camovic was also sentenced in New York state court on charges stemming from the same incident. Brooklyn Supreme Court Justice Danny Chun sentenced him to 30 years in prison.

"It’s a miracle none of these brave officers were killed when they were ambushed, stabbed, and shot by this brazen extremist," said Brooklyn District Attorney Eric Gonzalez. "We have no tolerance for violence toward our law enforcement colleagues, and this long prison sentence holds him accountable for his depraved and unconscionable crimes."

Camovic pleaded guilty to three counts of aggravated assault on a police officer, two counts of second-degree criminal possession of a weapon and one count of reckless endangerment in March of this year.

Camovic carried out the attack on June 3, 2020, while New York City was maintaining a coronavirus-related public health nightly curfew order. The attack also came amid George Floyd protests that were happening across the city.

NYC'S GUN-FREE ZONES DON'T 'MAKE SENSE' WITH EXPERTS CALLING STRATEGY 'LOW-HANGING FRUIT'

"After stabbing Officer 1, Camovic chased the second officer (Officer 2), lunging at him and attempting to stab him," the Justice Department said. "Camovic then ran back to Officer 1, attacked him, forcibly took control of Officer 1’s firearm and fired multiple shots at Officer 2 and other officers who responded to the scene.  Responding officers ultimately shot Camovic and took him into custody."

Knife used in Jihadist-Inspired Attack on New York City Police Department Officers

NYPD released a photo of the knife used in Dzenan Camovic's attack on NYPD officers. (NYPD)

The victims were identified as Police Officer Yayon Frantz Jean Pierre and Police Officer Randy Ramnarine.

During the attack, Camovic stabbed Jean Pierre in the neck before rushing at Ramnarine, according to the Brooklyn District Attorney’s office. The migrant then grabbed the wounded Jean Pierre's firearm and shot Ramnarine in the hand, causing him to lose a finger. 

CLICK HERE TO GET THE FOX NEWS APP

A third officer who responded to the scene was also shot in the hand, the office said.

The attack occurred near the intersection of Flatbush and Church Avenues in Brooklyn, New York.