Mayor Zohran Mamdani arrived at an Oct. 7 memorial event in Union Square on Wednesday to a chorus of boos and jeers from pro-Palestinian marchers, who disrupted an event organized by a pro-peace Israeli group with chants that expressed support for Hamas and accused the mayor of supporting genocide.

Those accusations came at the end of a day that had seen the mayor excoriated by Jewish leaders for a statement he made earlier that marked the third anniversary of the terrorist attacks, but focused mostly on the suffering of Palestinians in Gaza during the war that followed the Hamas-led assault.

The event, a candlelight vigil organized by Israelis for Peace New York, collapsed into chaos shortly before the mayor arrived at around 7:30, but organizers carried on inside a tight police cordon as protesters screamed at them throughout the evening. The protest appeared to be at least twice the size of the vigil.

Few protesters noticed when the mayor arrived, striding determinedly through a police barricade wearing a black coat and a solemn expression. He walked quickly up to the speaker’s dais, where he stood holding a candle throughout the ceremony.

Once protesters noticed him, they began to harangue him with chants that accused the mayor, a longtime critic of Israel, of being a coward and killing babies in Gaza.

The vigil was delayed by the arrival of the protesters. When they arrived, some protesters chased a man holding an Israeli flag, while two others rushed at the crowd. A larger group of protesters chanted “death, death to the I.D.F.,” referring to the Israel Defense Forces, and “resistance is glorious, we will be victorious,” as organizers of the vigil huddled together to figure out a response.

The protesters marched to Union Square from an earlier demonstration outside City Hall, where they accused the mayor — a longtime critic of Israel — of having betrayed the Palestinian cause.

That was in sharp contrast with the view held by Jewish leaders on Wednesday, who spent much of the day denouncing the mayor for a statement he released on the anniversary of the attack that had focused mainly on Palestinian suffering in Gaza.

Rabbi Rick Jacobs, the president of the Union for Reform Judaism, said the mayor’s statement had been “callous toward Jewish pain.”

“You cannot proclaim empathy and care for the Jewish community and then fail to show basic humanity toward us in our grief,” he added. “Turning this anniversary into an indictment of the Jewish state is not only hurtful and deeply offensive, but it also makes Jewish New Yorkers less safe.”

As protesters flooded into Union Square on Wednesday night, some attendees sat quietly. Vigil organizers retreated behind a line of police barricades, where groups of them solemnly embraced. Others rushed to the barricades, to be let in one by one through the crowd.

“We will persevere, but we will raise our voice and mourn our dead and demand to end the bloodshed,” Tamar Glezerman, an organizer of the vigil, said. “I wished that people would listen instead of shouted.”

Here’s what else to know:

The mayor and the prime minister: Mr. Mamdani has clashed with Prime Minister Benjamin Netanyahu of Israel, most recently last month when Mr. Netanyahu denounced the mayor in a speech to the United Nations General Assembly, calling him an antisemite and saying that Jewish New Yorkers were less safe under his leadership. Mr. Mamdani, who has repeatedly called Mr. Netanyahu a war criminal, accused the prime minister of using the speech to spread “baseless lies meant to sanitize his genocide of Palestinians.”

The attacks of Oct. 7, 2023: The terrorist attack on Israel resulted in the killings of roughly 1,200 people, including civilians and military members, and the abduction of 251 hostages. Israel’s subsequent campaign in Gaza has killed more than 73,000 Palestinians, according to a count from Gaza’s health ministry, which does not distinguish between civilians and combatants but which includes thousands of children.