A Bosnian illegal immigrant accused of stabbing a New York City police officer in the neck and stealing his gun, then chasing other officers, had an interest in Islamic extremism, prosecutors alleged on Thursday.

ILLEGAL IMMIGRANT RELEASED IN NYC AFTER ARREST FOR WEAPONS CHARGES, NOW ARRESTED ON GANG-RELATED CHARGES

Dzenan Camovic, 21, screamed “Allahu Akbar" as he approached Officer Yayonfrant Jean Pierre who was stationed at an anti-looting post on a Brooklyn street corner and stabbed him in the neck, according to surveillance and body camera footage of the June 3 incident as well as media accounts.

After the stabbing, Camovic is seen chasing another officer, Randy Ramnarine, before rushing back toward Jean Pierre. Ramnarine fired two shots at Camovic and Jean Pierre fired six times, according to authorities. Camovic then wrestled Jean Pierre's gun away from him and fired six shots — wounding Ramnarine and another officer in the hand, authorities said. Ramnarine and a responding sergeant returned fire. Both officers survived their injuries.

Camovic was hospitalized with gunshot wounds to the face, legs and torso before being moved to the city's Rikers Island jail complex. His injuries, including a shattered wrist and elbow, have required several surgeries and he is still receiving physical therapy, Camovic's lawyer, Robert Stahl told the Associated Press. Last month, a judge ordered Camovic to undergo a psychiatric evaluation.

While recovering days after the attack, federal prosecutors said, Camovic mistakenly told a worker at Kings County Hospital that he had killed two police officers and said that “my religion made me do it."

Stahl has denied that Camovic has ties to the Islamic State and said instead that his client “is a troubled young man in a number of respects, as opposed to having any terrorist or Islamic leanings,"

But prosecutors said evidence, which includes an interview with an unidentified person, shows that at least a year before the attack, Camovic started expressing interest in Islamic State and other Syrian-based terrorist groups and inquired about killing civilians.

The person told prosecutors Camovic did not have extreme religious beliefs.

Authorities uncovered CDs and a thumb drive in his Brooklyn home that contained audio and video lectures and sermons by Anwar al-Awlaki, a deceased Islamic cleric and reputed al-Qaeda leader.

The attack took place against a backdrop of protests and unrest in New York City following the death of George Floyd, a Black man being taken into custody by Minneapolis police.

Prosecutors said video from that night shows Camovic casing the area, crouching in corners and assessing the street.

According to federal prosecutors, Camovic texted a friend “Ill be a while” just before attacking Jean Pierre shortly before midnight. Camovic's phone contained deleted images of Arabic writing referencing the Islamic State and the name of a magazine it has used to radicalize and recruit followers.

In a statement, Attorney General William Barr said Camovic “used the cover of chaos" of the Floyd protests to commit a “premeditated and cowardly” attack. Barr said Camovic's alleged use of encrypted messaging and the hidden part of the Internet known as the dark web prevented investigators from learning more about his plans and who else may have been involved.

“If not for the heroism and bravery of the responding NYPD officers who returned fire and took the assailant down early in the attack, untold additional officers and innocents could have been killed or injured,” Barr said.

CLICK HERE FOR THE FOX NEWS APP

The Associated Press contributed to this report.