The improvised explosive devices thrown near New York Mayor Zohran Mamdani’s residence during weekend protests are being investigated as part of an act of “ISIS-inspired terrorism,” the city’s police commissioner said Monday.

Ibrahim Kayumi, 19, and Emir Balat, 18, face federal charges in connection with the incident Saturday. Both were charged with unlawfully possessing and using a “weapon of mass destruction,” transporting explosives and attempting to aid a “designated foreign terrorist organization,” according to a federal complaint filed in U.S. District Court for Southern New York.

Kayumi and Balat “have been charged with committing a heinous act of terrorism and proclaiming their allegiance to ISIS,” a common name for the Islamic State terrorist group, Mamdani said in a statement. “They should be held fully accountable for their actions. We will continue to keep New Yorkers safe. We will not tolerate terrorism or violence in our city.”

Authorities do “not have information that connects this investigation to what is going on overseas in Iran,” Police Commissioner Jessica Tisch said at a news conference Monday, referring to the U.S. and Israeli joint military offensive there.

Tisch said the objects thrown Saturday during an anti-Islam demonstration and counterprotest near Gracie Mansion, the mayor’s official residence, were “improvised explosive devices made to injure, maim or worse.”

She added that a third suspicious device tested negative for explosive material. At least one of the devices contained a dangerous and highly volatile homemade explosive. None of the devices detonated, and nobody was injured.

Zohran Mamdani speaks at a presser outsideNew York Mayor Zohran Mamdani at a news conference at Gracie Mansion in New York City on Monday.Angelina Katsanis / AP

In federal court Monday, attorneys for Balat and Kayumi requested protective custody for their clients at the Metropolitan Detention Center in Brooklyn. The two will be held pending an application for bail.

“This is a publicly declared terror trial, this is the city of New York, he’s 18, and he’s exposed to the general population of what is called a hellhole, and we want to keep him protected,” Mehdi Essmidi, Balat’s attorney, told NBC News after the hearing.

Essmidi added that Balat is a senior at a Pennsylvania high school who was three classes from graduation and has “complicated stuff going on in his personal life.”

The federal complaint alleges that Balat and Kayumi “attempted to detonate two apparent explosive devices in the vicinity of Gracie Mansion, in Manhattan, New York, during a protest and counter-protest in the area.”

Balat ignited one of the devices and threw it at protesters before running down the street and receiving a second device from Kayumi, the complaint alleges.

Balat ignited the second device and dropped it near multiple police officers, then ran away and jumped over a barricade before he was tackled by police and taken into custody, the complaint says. Kayumi was also also apprehended by officers.

“After being apprehended by NYPD officers, both Balat and Kayumi stated they were aligned with ISIS,” U.S. Attorney Jay Clayton said in a statement included as part of a Justice Department news release Monday.

Prosecutors alleged the pair hoped to inflict more carnage than the 2013 Boston Marathon bombing that killed three people.

“These men allegedly sought to inflict mass casualties in service to ISIS with the hope of exceeding the carnage of the Boston Marathon bombing,” Deputy Attorney General Todd Blanche said in news release.

Preliminary testing results of one of the devices indicated it contained “a highly volatile explosive material used in multiple terrorist attacks over the last decade,” the complaint says.

The complaint alleges that Balat and Kayumi made statements about ISIS when they were arrested. It adds that body camera video from the New York City police officers who arrested Kayumi captured him responding “ISIS” to someone in the crowd asking why he had done it.

In the complaint, federal law enforcement also alleged that both suspects referred to ISIS in recorded post-arrest statements they made after they received and waived their Miranda rights, with Balat writing on a piece of paper that he “pledge[d] allegience to the Islamic State.” Kayumi told police he watched ISIS propaganda on his phone, according to the complaint.

Tisch declined to comment at a news conference Monday afternoon when she was asked whether police suspected the teens were recruited or had self-radicalized, though Deputy Commissioner Rebecca Weiner broadly addressed a rise on online youth radicalization.

“It is not limited to ISIS; it’s across the ideological spectrum,” Weiner said.

Weiner said the NYPD and the FBI carried out “controlled detonations” of the IEDs from the protest. “It revealed a significant explosion,” she said, adding the devices would have caused “death” and “destruction.”

U.S. Attorney General Pam Bondi announced Monday that authorities “indicted the two alleged ISIS-inspired terrorists who attempted to bomb a protest in New York City.”

“We will not allow ISIS’s poisonous, anti-American ideology to threaten this nation. Our law enforcement officers will remain vigilant,” Bondi said Monday.

An automated license plate reader captured the car in which Balat and Kayumi were driving into New York City from New Jersey, which was registered to one of Balat’s relatives, about an hour before the noontime incident, according to the complaint.

The car was found a few blocks from where they were arrested. Inside, authorities found “a hobby fuse, an empty metal can” and a notebook with a handwritten list of chemical ingredients and components that could be used to build explosives, according to the complaint.

Balat and Kayumi are from Bucks County in Southeastern Pennsylvania, with Balat residing in Langhorne and Kayumi in Newtown, according to federal officials. Before his arrest, Kayumi’s mother had filed a missing person report saying she last saw him around Saturday morning.

Mamdani, New York City’s first Muslim mayor, confirmed Monday that he and his wife, Rama Duwaji, were at a museum in Brooklyn when the device was thrown. (Authorities had said the two were in Gracie Mansion during the incident.)

Mamdani, who addressed reporters at the start of Monday’s news conference, described the suspects as two men who “traveled from Pennsylvania and attempted to bring violence to New York City.”

“They are suspected of coming here to commit an act of terrorism. There is a video of these two individuals throwing two devices towards the protest,” Mamdani said.

The anti-Muslim demonstration, led by conservative influencer Jake Lang and called “Stop the Islamic Takeover of New York City, Stop New York City Public Muslim Prayer,” drew roughly 20 people, according to police.

The counterprotest drew about 125 demonstrators at its peak.

“Thanks to the swift and decisive actions of NYPD officers at the scene, both men were immediately taken into custody and the devices they brought taken off of our streets,” Mamdani said.

“I want to commend the officers who were on site,” he added. “They faced a chaotic situation that very quickly could have become far more dangerous.”

Tisch did not specify why investigators are probing links between the incident and the Islamic State terrorist group. The federal criminal complaint will be unsealed Monday afternoon, she said.

Mamdani told reporters Monday that the anti-Muslim demonstration was a “vile protest rooted in white supremacy.”

He added that “anti-Muslim bigotry is nothing new to me, nor is it anything new for the 1 million or so Muslim New Yorkers who know this city as our home.”

Mamdani then defended the right of the city’s residents to protest peacefully, saying, “While I find this protest appalling, I will not waver in my belief that it should be allowed to happen.”

“Ours is a free society where the right to peaceful protest is sacred,” he said. “It does not belong only to those we agree with. It belongs to everyone. I will defend that right every day that I am mayor, even when those protesting say things that I abhor.”