A resolution that would have condemned the militant group Hamas and its attacks on Israel failed to pass the United Nations on Thursday, despite an aggressive campaign by the United States and Israel to cast it as a vote on peace and terrorism.

The U.S.-drafted resolution got 87 votes in favor and 57 against, with 33 abstentions, meaning it fell short of the required two-thirds majority needed to pass. Nikki Haley, the U.S. ambassador to the United Nations, argued for a simple majority vote, but a last-minute rule change was passed that foreshadowed the resolution’s failure.

The vote was a personal defeat for Haley in what is likely to be one of her final major actions as the U.S. envoy. She is resigning effective at the end of the year and has made the fight against criticism of Israel in the world body a signature feature of her tenure.

The vote also represented a political disappointment for the Trump administration, which had lobbied hard to get many Arab states to break from their routine support of the Palestinian position and support the anti-Hamas resolution. But all the Arab states voted against it, even those that have signed peace treaties with Israel and are otherwise seeing warming relations with its government.

Their refusal to back the U.S. resolution comes just weeks before the White House is planning to unveil a proposal to bring the Israelis and Palestinians back to the negotiating table. Support from the Arab states is considered crucial to getting it launched, and the U.N. vote suggests it might get a standoffish reception.

Haley broke from her prepared remarks and made an impassioned plea to the Arab states to reach for a breakthrough in a conflict that has stretched seven decades since the founding of Israel. “I want to take a personal moment and ask my Arab brothers and sisters — is the hatred that strong?” she said. “Is the hatred toward Israel so strong that you’ll defend a terrorist organization? One that is directly causing harm to the Palestinian people? Isn’t it time to let that go? For true peace and security in the entire region, isn’t it time for both sides to let this go?

Danny Danon, the Israeli envoy to the United Nations, scolded the states that rejected the resolution. “Your silence in the face of evil reveals your true colors,” he said. “It tells us what side you are on — the side that does not care about the lives of innocent Israelis and innocent Palestinians who have fallen victim to the terrorists of Hamas.”

The Kuwaiti representative, speaking on behalf of the Arab bloc, condemned violence and extremism but expressed concern that the U.S. draft resolution skirted any mention of a two-state solution and sought only to condemn one party in the conflict.

Both Israel and the United States exerted considerable effort to persuade Arab states to join in a straightforward condemnation of Hamas, calling a denouncement of terrorism a basic building block for peace talks.

Diplomats from nine Arab countries were sent letters by Jason Greenblatt, the White House envoy who is working with Jared Kushner, Trump’s son-in-law and adviser, on the administration’s peace proposal.

“The time has come for all countries to take a stance on whether they are for or against Hamas’ violence,” said the letter addressed to envoys from Morocco, Kuwait, Saudi Arabia, the United Arab Emirates, Egypt, Qatar, Jordan, Bahrain and Oman.

Both Greenblatt and Haley have stepped up their criticism of Hamas, which has ruled the Gaza Strip since 2007. In recent months, the militant group has fired hundreds of rockets from Gaza into Israel.

“The UN has a chance to condemn Hamas for the first time,” Haley tweeted Thursday. “If the UN fails to do so, its lack of credibility will speak for itself.”

Haley has made support of Israel and criticism of the United Nations’ perceived anti-Israel bias a central cause. Before the vote, she sent a letter to the missions of all 193 U.N. member nations asking them to support the U.S. resolution.

“The United States takes the outcome of this vote very seriously,” wrote Haley, who repeatedly has said the administration will “take names” of any countries voting against U.S. foreign policy.

Israeli Prime Minister Benjamin Netanyahu said on Twitter that he “commended” all 87 countries that took a stand against Hamas. The fact that a majority backed the resolution, though insufficient for the measure to pass, was a “very important achievement for the United States and Israel,” he wrote.

Netanyahu has been under fire in recent weeks for his perceived soft stance toward Hamas — criticism that almost brought down his government. He faced a renewed challenge on that front Thursday as he allowed $15 million in cash from Qatar into Gaza to pay Hamas salaries.

The transfer of the money last month was one of the factors that former defense minister Avigdor Liberman noted as he quit the coalition, leaving Netanyahu with just a one-seat majority in the Knesset. Liberman also cited Netanyahu’s decision to enter into a cease-fire with Hamas just days later despite the worst round of rocket fire from Gaza since the 2014 war. The decision drew protests in Israeli communities around Gaza and seriously dented the prime minister’s security credentials.

Netanyahu defended his decision Thursday, shortly before pictures of the stacks of hundred dollar bills arriving in Gaza were circulated on social media. “It’s certainly more stable than it was before,” he said of Gaza. “My goal there was to first get quiet and then see if we can have a ­longer-term arrangement.”