The United Nations General Assembly on Thursday failed to pass a resolution condemning Hamas, serving a defeat to Israel and its American ally in their efforts for a first ever UN condemnation of the terror group after weeks of diplomacy.

While the US-backed draft resolution got a comfortable majority of votes, it fell short of the two-thirds super-majority needed to pass.

Eighty-seven countries voted in favor of the resolution, while 57 opposed it. Thirty-three countries abstained and another 23 were not present.

Get The Times of Israel's Daily Edition by email and never miss our top stories Free Sign Up

Israeli leaders still praised the outcome as a show of wide support for their position against the terror group, which for years has targeted Israel with rockets, bombs and other attacks.

“Today we achieved a plurality. That plurality would have been a majority if the vote had not been hijacked by a political move of procedure,” Israeli Ambassador to the UN Danny Danon said after the vote.

“But in one strong, courageous voice, we have brought Hamas to justice. For those member states that rejected this resolution, you should be ashamed of yourselves,” he said.

The resolution, entitled “Activities of Hamas and Other Militant Groups in Gaza,” would have condemned Hamas “for repeatedly firing rockets into Israel and for inciting violence, thereby putting civilians at risk.” It would have been the first General Assembly measure to specifically target the terror group, which is the de facto ruler of the Gaza Strip.

Prime Minister Benjamin Netanyahu also feted the 87 countries that voted for the measure, noting it was the first time such a large majority had taken “a principled stand against Hamas.”

Hamas, labeled a terror group by Israel, the US, Europe and elsewhere, hailed the failure of the resolution to pass as a “slap” to US President Donald Trump’s administration.

“The failure of the American venture at the United Nations represents a slap to the US administration and confirmation of the legitimacy of the resistance,” spokesman Sami Abu Zahri wrote on Twitter, using a phrase commonly used to refer to armed groups that oppose Israel.

Palestinian Authority President Mahmoud Abbas also welcomed the result, despite being engaged in a bitter intra-Palestinian rivalry with Hamas over control of Gaza. “The presidency thanked all the states that voted against the American draft resolution, affirming that it will not allow for the condemnation of the Palestinian national struggle,” a statement from the PA’s Wafa mouthpiece read.

Hamas leaders had embarked on a rare diplomatic campaign to garner support against the resolution in the days leading up to the vote, with Hamas head Ismail Haniyeh appealing to Arab countries, the UN and elsewhere.

Among those to vote against the measure were China and Russia, while India abstained, despite forging recent warmer ties with Israel. The measure was widely welcomed in Europe and the Americas, including Argentina and Brazil.

Last week, the European Union agreed the bloc’s 28 countries would back the measure, after the US agreed to make changes to the language.

In her introduction of the resolution, US Ambassador to the UN Nikki Haley had appealed on member states to leave aside their view of how an Israeli-Palestinian peace deal should look like and simply take a stand against terrorism.

“Today could be a historic day at the United Nations,” she said.

“The General Assembly has passed over 700 resolutions condemning Israel. And not one single resolution condemning Hamas. That, more than anything else, is a condemnation of the United Nations itself,” she went on.

Haley’s resolution first seemed doomed when Bolivia and several Arab states asked just before the vote to require a two-thirds majority.

General Assembly head María Fernanda Espinosa, explaining that several other delegations had approached her with the same request, ruled to have a vote on the matter, which passed 75-72. Twenty-six states abstained.

Danon warned that countries who voted against would see things differently when they had to deal with their own terror problems, though many of the countries who voted against have been wracked by militant Islamism for decades.

“Wait when you will have to deal with terrorism in your own countries. Your silence in the face of evil reveals your true colors. It tells us what side you are really on: a side that does not care for the lives of innocent Israelis and innocent Palestinians who have fallen victim to the terrorists of Hamas,” he said.

For the first time at the UN, a record 87 countries condemned Hamas for its rocket fire & use of civilian infrastructure for military purposes against Israel. I thank @nikkihaley for her hard work in forming an unprecedented coalition. We will continue to fight for the truth! pic.twitter.com/MBDLERD23y — Ambassador Danon (@dannydanon) December 6, 2018

Haley charged that “there’s nothing more anti-Semitic” than refusing to condemn terrorism when it is targeting the Jewish state.

Haley said that the people “who have suffered the most by Hamas are the Palestinians” themselves, urging member states to vote in favor of her resolution also for their sake.

“For the sake of peace, and for the sake of this organization, I respectfully urge my colleagues to support this resolution.”

The resolution would have demanded that “Hamas and other militant actors including Palestinian Islamic Jihad cease all provocative actions and violent activity, including by using airborne incendiary devices.”

It also condemned Hamas’s use of resources in Gaza to “construct military infrastructure, including tunnels to infiltrate Israel and equipment to launch rockets into civilian areas, when such resources could be used to address the critical needs of the civilian population.”

The resolution came weeks after Hamas and other Gaza terror groups fired over 400 rockets into Israel during a two-day flareup of violence with Israel.

The draft resolution also called on all parties to fully respect international humanitarian law, “including in regards to the protection of the civilian population.”

It encouraged “tangible steps towards intra-Palestinian reconciliation,” as well as “concrete steps to reunite the Gaza Strip and the West Bank under the Palestinian Authority and ensure its effective functioning in the Gaza Strip.”

Last week, European diplomats had asked, and the Americans agreed, to insert a clause that states that a future Israeli-Palestinian peace deal should be “in accordance with international law, and bearing in mind relevant UN resolutions.”

However, the document makes no explicit mention of a two-state solution, though virtually all recently passed UN resolutions passed on the subject do.

Resolutions adopted by the General Assembly are non-binding, but they carry political weight and are seen as a barometer of world opinion.

Ahead of the vote, Haley, who is slated to leave her post in the coming weeks, sent a letter to all UN missions to make clear that “the United States takes the outcome of this vote very seriously.”

“She would like to go out with something,” said a Security Council diplomat of the US-drafted resolution.

After the vote on the US-backed anti-Hamas resolution, the General Assembly voted on another text dealing with the Israeli-Palestinian conflict.

The brief resolution, proposed by Ireland, called for “the achievement, without delay, of a comprehensive, just and lasting peace in the Middle East on the basis of the relevant United Nations resolutions,” including Resolution 2334.

It also demanded “an end to the Israeli occupation” and reaffirmed the assembly’s “unwavering support… for the two-State solution of Israel and Palestine, living side by side in peace and security within recognized borders, based on the pre-1967 borders.

It was passed with 156 “yes” votes, six “no” votes and 12 abstentions.

Danon, speaking again after the vote, dismissed the text as “another anti-Israel resolution.”

AFP and Adam Rasgon contributed to this report.