A man convicted of ambushing a Philadelphia police officer with a hail of gunfire in the name of the Islamic State group has been sentenced to several decades in prison.

Edward Archer was ordered Monday to serve 48½ to 97 years.

A jury convicted Archer in February of attempted murder, aggravated assault and other charges stemming from the January 2016 shooting of Officer Jesse Hartnett in his patrol car.

Hartnett, who returned fire, spent two weeks hospitalized. 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's no indication he coordinated the attack with a terrorist organization. He also wasn't charged with a terrorism-related offense.