Fareed Mumuni, of Staten Island, was arrested Wednesday after he attempted to stab FBI agents investigating him for ties to an ISIS-inspired terrorist attack. Above, the federal court in Brooklyn is shown where Mumuni was scheduled to be arraigned Wednesday. Reuters/Shannon Stapleton

A New York man who was a self-described supporter of the Islamic State militant group attempted to stab a special agent of the FBI Wednesday during a search of his Staten Island home that was part of an ISIS-related investigation, according to court documents. The man, Fareed Mumuni, was scheduled to be arraigned Wednesday in federal court.

Mumuni, 21, was arrested after he attacked FBI special agents and other officers, a criminal complaint filed in federal court in the Eastern District of New York stated. “During the attack, Mumuni repeatedly attempted to stab an FBI Special Agent with a large kitchen knife,” it described.

Authorities arrived at his home at 6:35 a.m. Wednesday with a search warrant and asked Mumuni to take a seat on a living room couch. But Mumuni instead “lunged at the officers with a large kitchen knife” and tried multiple times to stab one of the agents, who was wearing body armor and “suffered only minor injuries,” according to the criminal complaint. The officers disarmed Mumuni and arrested him.

After being taken to an FBI office, Mumuni stated that he had pledged allegiance to the Islamic State militant group and intended to travel to territories it held. (The group controls large swaths of Syria and Iraq.) If he failed, he said, he planned to attack law enforcement officers. Wednesday’s attack had been planned all along, Mumuni admitted, according to the criminal complaint. In fact, he kept a knife, wrapped in a T-shirt, in his bed in the event authorities should come.

Mumuni had been under investigation by the Joint Terrorism Task Force, whose findings indicated he was “a fervent supporter of the foreign terrorist organization Islamic State of Iraq and the Levant,” using another name for the Islamic State group, which is also known as both ISIS and ISIL. Mumuni was conspiring with a man named Munther Omar Saleh and others to “provide material support and resources to ISIL,” the criminal complaint alleged.

In that document, the agent said he believed the 20-year-old Saleh, who was arrested Saturday, had been attempting to carry out a terrorist attack using an explosive device. Mumuni was accused to trying to help Saleh in the attack.

In a letter to the court, acting U.S. Attorney Kelly Currie requested that Mumuni be detained before his trial “because the defendant presents both a danger to the community and a risk of flight.” For the charges against him of attempting to murder a federal officer, Mumuni faces up to 20 years in prison.