Mayor Zohran Mamdani ignited intense anger from Jewish groups on Wednesday when he issued a statement marking the third anniversary of the deadly Oct. 7 attacks on Israel that focused largely on the suffering of Palestinians in Gaza.

The mayor posted a 211-word statement on social media that made reference to “the horrific war crimes” committed by Hamas and called the anniversary “profoundly painful for so many New Yorkers.”

However, the bulk of the statement provided a detailed denunciation of Israel’s military actions in Gaza since the attacks, which Mr. Mamdani described as a “devastating, ongoing genocide.” He did not provide a similarly detailed account of the killings of Israelis and abductions of hostages.

“The suffering did not begin nor end that day,” he said, referring to Oct. 7, adding: “That suffering has intensified with every Israeli bomb dropped on ambulances waiting outside hospitals, every drone strike targeting a residential building or journalist, and every shipment of food aid turned away at a border crossing.”

The remarks by Mr. Mamdani, who has a fraught relationship with much of New York City’s Jewish leadership, were highly anticipated and closely scrutinized because this is the first anniversary of the attacks on Israel since he took office in January.

And Wednesday’s statement was notably different from those released by other elected officials, including Gov. Kathy Hochul, who described Oct. 7 as “the deadliest day for the Jewish people since the Holocaust.” In its own statement, the City Council highlighted the story of an Israeli Jew who was hidden from Hamas by a Bedouin Muslim farmer on the day of the attacks.

Some pro-Israel Jewish leaders, and the Israeli government, accused the mayor of minimizing Jewish and Israeli pain on a day of profound grief.

Rabbi Ammiel Hirsch, the president of the New York Board of Rabbis, said Mr. Mamdani’s statement was “morally perverse” and “like sticking a knife into the pain of the Jewish community in New York and in America.”

“It is so offensive to so many Jews that it is hard to describe how offensive it is,” he said. “And it exacerbated the feeling that American Jews and New York Jews have had since he first came to prominence, which is that he has a problem with collective Jewish empowerment and he hates the state of Israel.”

Rabbi Rick Jacobs, the president of the Union for Reform Judaism, said the mayor 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.”

The UJA-Federation of New York, a major philanthropy, took issue with Mr. Mamdani’s description of the war in Gaza, saying he had chosen “to respond to the grief of Jewish New Yorkers by advancing false and inflammatory attacks against Israel — not only inappropriately shifting the focus away from the victims of Hamas’s cruelty, but also placing Jewish New Yorkers at risk.”

But some progressive Jews defended the mayor. Sophie Ellman-Golan, a spokeswoman for Jews for Racial and Economic Justice, a group supportive of Mr. Mamdani, said his statement on Wednesday had “struck exactly the right tone.”

“I think this is a really painful day for so many reasons,” she said. “It has been three years since that day, and three years of genocide. To act like there was a horrific attack and then nothing happened afterward — we cannot fail to acknowledge that.”

The uproar was a reminder of the degree to which the Israeli-Palestinian conflict has infused the mayoralty of Mr. Mamdani. The mayor’s comments echoed a statement he made on last year’s anniversary, reflecting his consistent stance on the issue even as his platform has grown significantly.

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 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.

Israel’s conduct of the war has drawn broad international condemnation and caused a significant drop in public support for the country in the United States, its most important ally. That shift in public opinion has been especially pronounced among Democrats and young people, with a majority of both groups expressing a negative view of the Jewish state, according to the Pew Research Center.

On Wednesday, pro-Israel and pro-Palestinian groups held separate events to express their grief and outrage over the Oct. 7 attacks and the ensuing war, which has devastated Gaza and spread to Lebanon, Iran and elsewhere in the Middle East.

Many Jewish groups organized ceremonies to remember those who died in the attacks, including an event at the Museum of Jewish Heritage and a candlelit vigil in Union Square organized by Israelis for Peace New York, where organizers said they would also mourn those killed in Gaza.

For their part, pro-Palestinian groups protested Israel’s military action in Gaza — which a U.N. commission and some international and Israeli human rights groups have described as a genocide, a claim the Israeli government has denied — as well as the wars in Lebanon and Iran.

The mayor’s outreach to pro-Israel Jewish groups has outraged some pro-Palestinian activists who accuse Mr. Mamdani of betraying their movement. To underline that point, some attendees at a pro-Palestinian rally outside City Hall on Wednesday expressed opposition to Mr. Mamdani.

“He is just as complicit,” Jon Brule, one protester at the rally, said as he held a sign that referred to Mr. Mamdani as “on the side of genocide.” “He’s betrayed the interest of the Palestinians.”

Tamar Glezerman, an organizer of the Israelis for Peace vigil in Union Square, said it was important to treat Wednesday as a day of mourning “while also not ignoring the aftermath of this massacre,” which she described as a genocide in Gaza.

“There is this fallacy out there that if you mourn or feel the pain of one side, that somehow cancels the other side or legitimizes violence against the other side,” added Ms. Glezerman, whose aunt was killed in the Oct. 7 attacks.

Wesley Parnell contributed reporting.