NEW YORK (Reuters) - A U.S. federal appeals court on Friday ordered the resentencing of a Staten Island, New York man for attempting to provide material support to Islamic State and kill an FBI agent, saying his 17-year prison term was “shockingly low.”

The 2nd U.S. Circuit Court of Appeals in Manhattan said Fareed Mumuni’s trial judge abused her discretion in imposing a term that was 80% below the 85 years recommended by federal guidelines, and even below the 18-year term for co-defendant Munther Omar Saleh, who was not accused of attempted murder.

In a 2-1 decision, the court said U.S. District Judge Margo Brodie improperly second-guessed whether Mumuni, 25, intended to kill FBI Special Agent Kevin Coughlin in June 2015 by stabbing him repeatedly with an 8-inch kitchen knife in Mumuni’s home.

It also said Brodie gave too much weight to mitigating factors such as Mumuni’s age, his lack of a prior criminal record and support from family and friends.

Such errors “caused the district court to render a sentence that is shockingly low and unsupportable as a matter of law,” Circuit Judge Jose Cabranes wrote for the majority.

Mumuni’s lawyer did not immediately respond to requests for comment. A spokesman for U.S. Attorney Richard Donoghue in Brooklyn, whose office appealed the sentence, declined to comment.

Coughlin survived the attack.

Federal sentencing guidelines are advisory, but judges must sufficiently justify major departures resulting in sentences that might appear unusually lenient or harsh.

Downward departures are more common, though an 80% reduction is larger than average, according to federal statistics.

Mumuni had pleaded guilty in Feb. 2017 to an indictment charging him with trying to aid Islamic state, attempted murder of federal officers, and assaulting federal officers.

Prosecutors said Mumuni pledged allegiance to Islamic State and tried to raise money to travel to areas it controlled, and had received permission from an “attack facilitator” for the group to use a pressure-cooker bomb against law enforcement officers.

Circuit Judge Peter Hall, who dissented, said he feared the majority “would prefer to substitute its sentencing preference for that of the district court,” but agreed that the case should be returned to Brodie so she could better explain her reasoning.

The United States designates Islamic State a foreign terrorist organization.

The case is U.S. v. Mumuni, 2nd U.S. Circuit Court of Appeals, No. 18-1604.