Munther Omar Saleh, 21, of Queens, and Fareed Mumuni, 22, of Staten Island, were charged with "conspiring and attempting to provide material support" to ISIS and with assaulting and conspiring to assault federal officers, the US Attorney's Office for the Eastern District of New York said in a statement.
Mumuni also was charged with "attempted murder of federal officers." That charge resulted from an incident in which Mumuni repeatedly stabbed an FBI agent as law enforcement officials carried out a search warrant at his home about two years ago, officials said.
Saleh, a US citizen and a former aeronautics student, faces up to 53 years in prison. Mumuni's immigration status is not clear; he faces up to 85 years in prison.
Both men are scheduled to be sentenced May 16.
"Today's guilty pleas show just how close the threat of homegrown terrorism exists for New York City," William F. Sweeney, Jr., assistant director-in-charge of the FBI's New York field office, said in a statement.
"From their respective homes in Queens and Staten Island, Saleh and Mumuni conspired to place a pressure cooker bomb in the New York metro area on behalf of ISIL," he said, using another term for ISIS.
"Mumuni even attacked an FBI agent when a court-authorized search was being conducted by the Joint Terrorism Task Force at his home in Staten Island. Threats like this are exactly why protecting the United States from a terrorist attack remains the FBI's No. 1 priority."
FBI agent attacked
Saleh and another individual were taken into custody on June 13, 2015 in Queens after they charged at a federal officer who was performing physical surveillance of Saleh, according to Friday's statement.
Both men were armed with knives, the statement said.
Mumuni was arrested in the same month after he repeatedly stabbed an FBI agent in the torso
with a large kitchen knife after FBI agents arrived at his Staten Island home to execute a search warrant, officials said.
"During his arrest, Mumuni stabbed an FBI agent numerous times, but thankfully the agent's body armor protected him from the defendant's attack and the defendant was safely apprehended by law enforcement," acting Assistant Attorney General for National Security Mary B. McCord said Friday.
During a search of the vehicle used by Mumuni, investigators recovered a second large knife, the statement said. After his arrest, Mumuni admitted that he kept a knife wrapped in a T-shirt in his bed to use in any confrontation with law enforcement officers.
Mumuni also said an ISIS fighter had sanctioned his planned suicide attack on law enforcement officials following him, according to the statement.
Instructions from ISIS in Syria
"Saleh and Mumuni engaged in plotting attacks against New York City in the name of ISIL," New York Police Commissioner James P. O'Neill said. "They received instructions from senior ISIL leaders in Syria. They were committed to violence."
Electronic surveillance revealed that Saleh had emailed himself information about the construction of pressure cooker bombs and that he had also conducted Internet searches of notable New York landmarks and tourist attractions, according to a federal complaint.
A pressure-cooker device was used in the Boston Marathon bombings
Saleh and Mumuni werearrested in 2015, a year that saw a record 54 arrests in ISIS-linked cases in the United States. By contrast, there were 14 arrests in such cases last year and 13 in 2014.
"ISIS' extreme brutality, their battlefield setbacks, vigorous US law enforcement efforts, and the sharp and consistent criticism of ISIS by the vast majority of American Muslims has significantly dented ISIS' support in the United States," said CNN Terrorism Analyst Paul Cruickshank.
Saleh, Mumuni and others also helped plan a New Jersey man's trip to ISIS-controlled territory, the statement said.
Saleh personally accompanied that man, Nader Saadeh, to John F. Kennedy International Airport, where Saadeh began his trip with a flight bound for Jordan, according to Friday's statement. Saadeh was arrested and later pleaded guilty to conspiring to provide material support to ISIS.
"In the name of ISIL's false and hateful ideology, these defendants attacked the law enforcement officers who work tirelessly to preserve the safety of our communities," said Robert L. Capers, United States Attorney for the Eastern District of New York.
"These convictions will help incapacitate these defendants and send a strong message to those who would follow in their footsteps."