UNITED NATIONS (Reuters) - A U.S. attempt to get the United Nations to condemn violence by Palestinian militant group Hamas for the first time failed on Thursday because the draft resolution fell short of votes needed in the General Assembly.

The resolution required two-thirds support and while Assembly resolutions are non-binding, they can carry political weight. The U.S. text received 87 votes in favor, 58 against, 32 abstentions and 16 countries did not vote.

In an earlier procedural move requested by Kuwait, the 193-member body narrowly voted to require two-thirds support and not a simple majority for adoption of the draft resolution.

Outgoing U.S. Ambassador to the United Nations Nikki Haley had written to member states on Monday to urge them to vote for the U.S.-drafted text, warning them: “The United States takes the outcome of this vote very seriously.”

Haley, who will step down at the end of the year, has been a staunch defender of Israel.

“Before the General Assembly can credibly advocate compromise and reconciliation between the Palestinians and Israel, it must on record, unambiguously and unconditionally, condemn Hamas terrorism,” Haley told the body before the vote.

The United States is working on a long-awaited plan to broker peace between Israel and the Palestinians, but the Palestinians are skeptical and have accused the Trump administration of siding with Israel on core issues.

Hamas official Sami Abu Zuhri told Reuters that “rejecting the American drafted resolution against the resistance represents a blow to the American administration and reaffirms the legitimacy of the resistance.”

Israel’s U.N. Ambassador Danny Danon said the countries that rejected the draft resolution should be ashamed. Israeli Prime Minister Benjamin Netanyahu commended those that voted in favor.

Israel captured Gaza in the 1967 Middle East war but withdrew in 2005, while holding onto most of the separate West Bank, where Palestinians have limited self-rule.

For more than a decade Gaza has been controlled by Hamas under an Israeli-Egyptian blockade. The economy has collapsed, creating what the World Bank describes as a humanitarian crisis with shortages of water, electricity and medicine.

Israel says it has no choice but to enforce its blockade to defend itself against Hamas, which calls for Israel’s destruction and has used Gaza as a base for missile attacks.

Iran’s Deputy U.N. Ambassador Eshagh Al Habib accused the United States of trying to deflect the attention of the world from the root causes of the conflict and said “we recognize Hamas as a legitimate resistance movement fighting for the liberation of Palestinian territory from foreign occupation.”