Two New York City men have been charged with trying to provide support to the Islamic State of Iraq and the Levant, or ISIL, federal prosecutors said Tuesday, two months after they were arrested separately after hostile dust-ups with law enforcement.

Both men -- Munther Omar Saleh of Queens and Fareed Mumuni of Staten Island -- were named in the federal grand jury indictment in Brooklyn on Tuesday. A news release from the office of acting U.S. Attorney for the Eastern District of New York Kelly T. Currie said both men "espoused radical jihadist beliefs and fervent support for ISIL," and that Mumuni, 21, and Saleh, 20, plotted together. Currie's office said Saleh also tried to make a "pressure cooker" bomb with plans to detonate it in New York metro area.

On June 13, Saleh -- a Queens aeronautics student who lived in Medford with his family about six years ago -- and an unnamed individual were arrested in Queens after they charged at a federal officer just off the Whitestone Expressway while armed with knives.

Before the arrest, Saleh had been seen behaving suspiciously at the George Washington Bridge, had indicated support for ISIL in online postings, had researched bomb-making and referred to being involved in an "op" in email correspondence, the government said at the time. He also had an ISIS video stored on his computer.

On June 17, during a search warrant executed at his home, Mumuni was arrested after repeatedly stabbing an FBI agent in the torso with a large kitchen knife. Prosecutors said the knife did not penetrate the agent's body armor.

In a wiretap on Saleh's cellphone, the two men had been caught talking about attacking law enforcement officers earlier in June, the FBI said at the time. The FBI said Mumuni had asked for guidance and Saleh had told him to use a bomb, then run over members of law enforcement with a vehicle, seize their weapons and then use them to shoot at victims.

Mumuni also said he had pledged his allegiance to ISIL, and planned to join the group in territories it controlled, the FBI said at the time.

Saleh is charged with attempt and conspiracy to provide material support to ISIL, and assault and conspiracy to assault federal officers, prosecutors said Tuesday. The indictment charges Mumuni with attempt and conspiracy to provide material support to ISIL, assault and conspiracy to assault federal officers, and attempted murder of federal officers.

Both are scheduled to be arraigned Aug. 20 at 11 a.m. before U.S. Magistrate Judge James Orenstein at the U.S. Courthouse in Brooklyn. If convicted, Mumuni faces a maximum of 85 years in prison and Saleh faces a maximum of 65 years.