A man accused of ambushing a Philadelphia police officer with a hail of gunfire in the name of the Islamic State group was convicted Thursday of attempted murder.

Edward Archer also was found guilty of aggravated assault and other charges stemming from the January 2016 shooting of Officer Jesse Hartnett in his patrol car. The verdict came after the panel deliberated for less than three hours.

Hartnett, who returned fire, spent two weeks in a hospital. His arm was broken, and he suffered nerve damage.

When questioned by police, Archer repeatedly pledged his allegiance to the Islamic State and said he acted out of religious inspiration. But authorities have said there is no indication Archer had coordinated the attack with a terrorist organization. He also was never charged with a terrorism-related offense.

Archer's court-appointed attorneys had unsuccessfully sought last year to have him ruled incompetent to stand trial. Archer's mother said after the shooting that her son had been hearing voices and acting strange, but Archer declined to submit to mental health evaluations while awaiting trial. A judge later determined that he was aware of his situation and was simply refusing to cooperate.

During the trial, jurors watched a surveillance video that shows a person in an all-white gown unloading a handgun into the driver's side of a squad car. The gunshots, pointed out by a detective who noted the small flashes of light from the muzzle of the firearm, are let off in rapid succession as the person approaches closer and closer until the person's hands appear to be inside the shattered window of the vehicle.

The shooter flees and is followed on foot by a wounded Hartnett, the video shows. Archer was arrested a few blocks away, authorities said.

Archer faces several decades in prison when he's sentenced later this year.