NEW YORK — The 17-year federal prison term given to an Islamic State devotee who tried to kill an FBI agent searching his New York City home is "a shockingly low sentence" and must be amended, an appellate court said in a decision published Friday.

A panel of judges from the U.S. Court of Appeals for the 2nd Circuit ordered Fareed Mumuni resentenced by the judge who originally sentenced him in the Eastern District of New York.

The 25-year-old U.S.-born citizen pleaded guilty in February 2017 to conspiring to provide support to the Islamic State and attempting to murder a federal agent. His plea was not part of a deal with prosecutors and federal sentencing guidelines recommended 85 years in prison for the crimes he admitted to.

Two of the judges on the three-member panel found that U.S. District Judge Margo K. Brodie’s far lower sentence was “substantively unreasonable” in light of the seriousness of the case, which the judge “drastically discounted.” Brodie wrongly credited mitigating factors put forth by the defense in her calculation, the majority found, buying a “sterilized and revisionist interpretation of the record.”

“This clearly erroneous assessment of the evidence leaves us with the definite and firm conviction that a mistake has been committed — a mistake that resulted in a shockingly low sentence that, if upheld, would damage the administration of justice in our country,” according to the ruling written by Judge Jose A. Cabranes.

Mumuni and co-defendant Munther Omal Saleh, a self-proclaimed “full-fledged” member of the Islamic State who was handed an 18-year sentence, planned to carry out a pressure-cooker bomb attack in New York City, according to the U.S. attorney’s office in Brooklyn.

When federal agents executed a search warrant at Mumuni’s Staten Island home on June 17, 2015, the suspect charged at FBI special agent Kevin Coughlin and stabbed him repeatedly in the torso with a kitchen knife that had an eight-inch blade. The agent was spared from serious harm by his protective body armor and the metal magazine carrier he wore under his vest.

Mumuni admitted he kept a knife wrapped in a T-shirt on his bed so he would be ready to attack any law enforcement officer who might attempt to arrest him at home. He said he kept another knife in his car for the same purpose.

The judges said the break Brodie gave to Mumuni came from a misreading of the facts in the case.

Brodie “impermissibly second guessed — after accepting Mumuni’s guilty plea — whether Mumuni actually intended to kill his victim and whether the eight-inch kitchen knife he wielded during his attack on law enforcement constituted a deadly or dangerous weapon,” the ruling said.

One of the judges on the panel, although agreeing to send the matter back to the district court, said Brodie could resentence Mumuni to 17 years if she offers valid reasoning for her decision.

Mumuni’s lawyer Anthony Ricco said in a phone interview: “We believe that Fareed Mumuni in fact is a far more dynamic and compassionate human being than described by the Court of Appeals, and we are and will be prepared for the resentencing.”