To most Americans, there is a certain sameness to their country’s role at the United Nations, and this role is not an especially pleasant one. While many U.S. ambassadors have served ably, few have won public acclaim beyond diplomatic circles. Daniel Patrick Moynihan and Jeane Kirkpatrick clearly did. Many would add to that distinguished short list Ambassador Nikki Haley, who recently ended her two-year UN tenure.

Haley’s time was marked by several achievements, from North Korea sanctions, to the South Sudan arms embargo, to financial savings and reforms. But she was probably best known for her record on Israel. In fact, Israel’s UN ambassador, Danny Danon, went as far as saying, “With Nikki Haley’s appointment as U.S. ambassador to the United Nations, a new era was born.”

Was a new era really born? If so, what was new about it? And how did it happen that the former South Carolina governor who had never been to either Israel or the United Nations before accepting this diplomatic assignment would come to earn this reputation as a pathbreaker, a reputation now widely endorsed by both friends and enemies of Israel? I have thoughts on these questions, having served as Haley’s deputy and as a member of the National Security Council’s Deputies Committee. I worked closely with her on policy-making throughout her time at the UN, including on the Middle East and Israel–Palestinian issues.

Myths are sometimes assets in international relations. The fiction that Taiwan is not an independent country, for example, allows us to sustain our relationship with China. In other cases, however, myths can create serious problems. On Israel–Palestinian issues, the Trump administration was determined to test some mythical propositions that many had come to take for granted and, in some cases, to refute them. Haley’s prominence at the UN arose in large part from a conscious choice to reject myths that pervaded diplomacy on Israel–Palestinian issues for decades.

Four factors account for Haley’s extraordinary performance.

First, she served a president for whom pro-Israel positions came naturally. President Donald Trump supported everything Haley did at the UN. Had he not, she would not have been able to do to it.

Second, Trump does not micromanage people he trusts. Trump and Haley got along quite well. They spoke frequently and he valued her counsel. On no Israeli issue did he ever stand in her way.

Third, like Jeane Kirkpatrick in the 1980s, but unlike UN ambassadors in Republican administrations since then, Haley was a member of the president’s Cabinet and National Security Council. This status gave her greater standing with her UN colleagues in New York. She was a policymaker, not just a messenger. She had a greater ability than many of her predecessors to push things through the bureaucracy in both New York and Washington, which she did frequently.

And fourth, Haley decided early in her tenure that American interests at the UN, and American principles more broadly, required steadfast support for Israel. Indeed, she came to this conclusion before her January 24, 2017, Senate confirmation.

Donald Trump had campaigned for president as an outspoken critic of the Iran nuclear deal and other aspects of President Obama’s Middle East policies. Then, in the period between the election and inauguration, a pivotal event occurred that crucially shaped thinking about the Middle East in the minds of Haley and the wider Trump foreign-policy team.

On December 23, 2016, the United Nations Security Council approved Resolution 2334. The resolution not only denounced Israeli settlement activity, but it went much further. It condemned Israeli activity in all territories acquired in the 1967 war. That included the Jewish quarter of Jerusalem’s Old City—home to the holiest site in Judaism. It’s an area that no Israeli leader would ever negotiate away.

Similar efforts had been made at the UN many times in the past without success. But this was the first resolution of any kind regarding Israel to pass in the Security Council since 2009, and the first approved resolution on Israeli settlements since 1980. Resolution 2334 passed because the United States broke with its own long-standing practice of vetoing resolutions that unfairly attack Israel. Officially, the U.S. abstained. In fact, the Obama administration orchestrated the resolution’s passage by pledging privately that it would not veto.

There were two major problems with Resolution 2334. First, America had betrayed its close ally in the very forum in which Israel is most diplomatically vulnerable—a forum that has witnessed notorious anti-Semitic scenes in the past. And second, the resolution sent exactly the wrong message to Palestinian leaders. Namely, that they don’t have to negotiate peace with Israel and can nevertheless count on using international forums to validate their most far-reaching aims, including in Jerusalem.

President-elect Trump and his team were quick to denounce the resolution. At her Senate confirmation hearing just four weeks later, Haley proclaimed, “Last month’s passage of UN Resolution 2334 was a terrible mistake, making a peace agreement between the Israelis and the Palestinians harder to achieve.” She went on: “The mistake was compounded by the location in which it took place, in light of the UN’s long history of anti-Israel bias. I will not go to New York and abstain when the UN seeks to create an international environment that encourages boycotts of Israel. In fact, I pledge to you this: I will never abstain when the United Nations takes any action that comes in direct conflict with the interests and values of the United States.”

History is filled with examples of actions that produce the exact opposite of what was intended. Resolution 2334 belongs on that list. Palestinian leaders hailed its adoption. But it proved a pyrrhic victory for them, for it created a fierce backlash that set back many other Palestinian objectives.

Haley viewed passage of 2334 as a betrayal of American values and interests. She understood that the Security Council would not repeal it, but she was determined to do what she could to undo the damage. It was with that understanding that she walked into the United Nations three days after her confirmation and at her first encounter with reporters said, “It’s a new day for the United States at the UN. We will have the backs of our allies, and we will make sure our allies have our back as well.”

Haley’s first test came unexpectedly. This was the curious case of Salam Fayyad. In her first week on the job, it came to our attention that the UN secretary general intended to appoint Fayyad, the former Palestinian Authority prime minister, as UN special envoy to Libya. This appointment made some sense. Fayyad was well respected in the Arab world and the West. Libya was a mess, and the talented Fayyad might be able to help.

Coming close on the heels of passage of Resolution 2334, however, we saw two difficulties with the appointment. First, when such appointments are made at the UN, the appointee’s country is listed alongside his name. Fayyad was listed as representing the “State of Palestine.” But the United States recognizes no such state, and the “State of Palestine” is not a member of the United Nations. We did not want to casually accept this recognition of a mythical state. Second, in Israel’s 70 years as a bona fide UN member state, no Israeli citizen has ever received an appointment to a UN position of this kind.

Such appointments require the unanimous backing of the Security Council members, and we were informed that the other 14 countries did not object and that an American decision was required immediately. Previous U.S. administrations of both political parties would likely have allowed the Fayyad appointment to happen. The question for us was just how far we were willing to take our new commitment to fighting the UN’s anti-Israel bias.

In those first days of the new administration, the secretary of state had not even been confirmed. Haley phoned President Trump aboard Air Force One and explained the situation. The president asked, “What do you think?” Haley said she thought we should object. The president replied, “Good, do it.” And that was that.

The Fayyad rejection met with considerable criticism. Some of this was thoughtful; Bush-administration veterans who had worked well with Fayyad, for example, vouched for his capabilities and wondered what the Trump team was thinking. Some of the criticism was hyperbolic; one Democratic congressman accused Haley of ethnic bias against Palestinians.

The Israeli government played no role whatsoever in this decision. The Israelis were not consulted. In fact, they were taken by surprise. I assume they believed that the Trump administration was not going to intervene, and they probably had no major objection to a reasonable Palestinian leader working on behalf of peace in Libya. After the decision was announced, however, the Israelis complimented it. Prime Minister Netanyahu said, “The time has come for parity in the attitude toward Israel, and that the Palestinian side can’t be given freebies all the time.”

One got the sense that the Israelis had begun to figure out that this might in fact be the new day at the UN that Haley had announced. The UN secretary general and the other Security Council members very much got that message.

On a personal level, Salam Fayyad was a victim of being in the wrong place at the wrong time. On a policy level, the word went out that in the matter of UN appointments, the U.S. would not allow Palestinians to be treated better than Israelis.

One of the first large policy areas we confronted was the question of whether to continue U.S. participation in the United Nations Human Rights Council. The Human Rights Council (HRC) had long been hostile to Israel and was a badly flawed human-rights institution more broadly. An organization whose membership included China, Cuba, Venezuela, and other of the world’s most oppressive regimes could hardly be counted on as a human-rights advocate. If its only flaw was ineffectiveness, the HRC would not have been so objectionable. But it was much worse. The world’s bad actors would take advantage of the council’s “human rights” imprimatur to press their own political agendas. Those agendas included protecting themselves from criticism and scapegoating Israel. From 2006 to 2016, the HRC condemned China zero times, Iran six times, North Korea nine times, and Israel 68 times.

In 2006, the Bush administration declined to seek another U.S. term on the council. The Obama administration reversed course, and the U.S. rejoined the council in 2009. When the Trump administration came to office, the U.S. was in the middle of its term. No country had ever resigned from its seat on the HRC. The question was whether we should.

At the top levels of the administration, there was no disagreement that the HRC was a disaster. However, withdrawal from the HRC was more complicated than our earlier withdrawal from another notoriously anti-Israel UN body, UNESCO. At Haley’s urging, shortly after UNESCO declared the Jewish holy site in the old city of Hebron as a Palestinian World Heritage Site in need of protection from Israel, the U.S. announced it would withdraw from the organization. Again, as with Salam Fayyad, we did not coordinate in advance with the Israelis. We left UNESCO not at Israel’s behest but based on our own judgment that UNESCO damaged U.S. interests. Israel then joined us on the way out the door.

The HRC was a different case for two reasons. First, from its earliest days, the Trump administration was criticized by political opponents for caring little about human rights. An abrupt retreat from the United Nations Human Rights Council would have been interpreted by many as confirmation of this criticism. Second, we had heard from several pro-human-rights countries that they were keen to try to reform the HRC to make it harder for outlaw regimes to gain membership and to stamp out the anti-Israel bias. Haley was convinced that was an objective worth pursuing, and she took it on with a passion.

What ensued was a serious effort to save the Human Rights Council from itself. At the end of a strenuous year-long campaign, we ended up where we suspected we would, though we had hoped to avoid it: The U.S. withdrew. The reform effort, however, demonstrated that the administration made a good-faith attempt to fix the UN’s main human-rights organ. It also demonstrated why the world’s free countries have such difficulty advancing their principles in multilateral institutions that depend on unfree countries’ support.

Here’s how it happened: In June 2017, we went to HRC headquarters in Geneva and met with ambassadors from “like-minded” countries—mostly Europeans, with a smattering from Latin America, Africa, and Asia. They were in full agreement that we should keep dictatorships off the council, and they were embarrassed by the council’s disproportionate focus on Israel. But in the typical UN way, they sought only incremental changes. We had no interest in that.

On that trip to Geneva, Haley gave a speech in which she named the two conditions for continued U.S. participation. One was membership reform to keep extreme human-rights abusers off the council. The other was elimination of Agenda Item Seven, which was solely dedicated to Israel. No other country had an agenda item dedicated to it, and its existence showed precisely what was wrong with the council. We would not remain unless Agenda Item Seven was removed.

For a full year, the U.S. Mission to the UN held dozens of meetings to gain support for our reforms. President Trump championed it in his 2017 UN General Assembly speech. Vice President Mike Pence led a multilateral meeting on it at the UN. But all to no avail. Russia and China actively opposed our efforts, as expected. The Europeans were the bigger disappointment. They talked a big game but were never willing to expend capital to achieve serious changes, despite their strong preference that the U.S. stay on the council.

We could have accepted the status quo at the HRC—many made the argument that the U.S. would gain more by staying engaged than withdrawing. We could have accepted cosmetic changes and claimed a victory. We could have completed our term and not run for a new term. But that’s not what we were there to do.

For Haley, this was a matter of accountability. She had been transparent about her goals, and she tried very hard to fix the Human Rights Council. When it became clear that it was irredeemably biased against Israel and impervious to reforming its own membership rules, she concluded that it was time to leave. Haley understood that American participation in international forums is not something that’s taken lightly by the rest of the world. Our willingness to participate can be a major source of leverage because it’s important to other countries.

As Haley said upon the U.S. withdrawal, “Many of these [Western] countries argued that the United States should stay on the Human Rights Council because American participation is the last shred of credibility that the council has. But that is precisely why we must leave. If the Human Rights Council is going to attack countries that uphold human rights and shield countries that abuse human rights, then America should not provide it with any credibility.”

The Human Rights Council is mostly symbolic. But another matter that consumed much time and effort had more practical consequences. That was our treatment of the UN agency devoted to providing social services to Palestinian refugees, the United Nations Relief and Works Agency for Palestinian Refugees in the Near East, known as UNRWA.

Many have long raised serious concerns about UNRWA. Instead of helping integrate children into communities—thus ending their refugee status—UNRWA uses a unique definition of refugee in order to perpetually increase the Palestinians’ supposed refugee population. It extends refugee status to descendants of refugees, regardless of their circumstances, including having citizenship in another country. This encourages multigenerational dependency on international generosity. UNRWA perpetuates the Palestinians’ mythical “right of return,” implementation of which would extinguish Israel as a Jewish-majority state. Additionally, in Gaza, Hamas terrorists have shielded their activities inside and underneath UNRWA facilities.

At the same time, UNRWA does provide education and health-care services to hundreds of thousands of children in desperate conditions. And unlike the Human Rights Council, where our commitment vacillated from one administration to the next, the U.S. had been UNRWA’s chief financial backer for decades. UNRWA also had strong defenders within the national-security bureaucracy. When the Trump administration entered office, this bipartisan and bureaucratic support for UNRWA made far-reaching changes in our approach seem unlikely.

In June 2017, Haley and I visited the Aida Palestinian refugee camp just north of Bethlehem in the West Bank. The circumstances of the children in this and other camps is truly moving. They deserve a good education and a good future just the same as any other children. The question was whether UNRWA, absent major structural reforms, could deliver it.

Events that followed made the Trump administration’s support for UNRWA less tenable.

UNRWA’s leadership and its international backers showed themselves resistant to reforms. I met several times with UNRWA Commissioner General Pierre Krahenbuhl. A pleasant Swiss diplomat, Krahenbuhl fulfilled his duty to hear the concerns of his agency’s number-one financial supporter. But he heard them with incredulity. He couldn’t fathom what we were asking of him, and we were unsatisfied with his unbending responses.

One conversation in particular encapsulated the impossibility of the relationship. In my State Department office, I directed Krahenbuhl’s attention to the Hamas terrorist tunnels that had been discovered several times in recent years underneath UNRWA school facilities in Gaza. These discoveries always happened by accident, for example, when structural repair work was going on at a school and workers dug into a tunnel. In each case, UNRWA officials denounced this illegal misuse of UN facilities and destroyed the tunnel, claiming this as proof that they really opposed Hamas’s activities.

Experts in the U.S. oil and gas industry had told me that it would be fairly easy and inexpensive to use geological equipment to detect these tunnels from the ground surface. So I asked Commissioner Krahenbuhl: If the U.S. gave this equipment to UNRWA, would he use it to expose terrorist exploitation of UNRWA facilities? His answer was “no.”

Krahenbuhl claimed that such a detection effort would be too provocative and would involve UNRWA, a social-service provider, too deeply in political and possibly military matters. He further noted UNRWA’s long-standing position that it must accommodate itself to the host government wherever it operates.

In Gaza, that’s Hamas. In Syria, it’s a regime run by a major war criminal. In Lebanon, the host government is under the powerful influence of Hezbollah terrorists. If resisting the hijacking of UNRWA facilities and standing up to exploitation by extremely bad actors were inconsistent with UNRWA’s mandate or practice, then there was real doubt that the Trump administration could continue to endlessly bankroll it.

The other big factor that led to the U.S.–UNRWA breach was the administration’s general attitude toward foreign aid. President Trump had long been skeptical of aspects of the U.S. foreign-aid program. The UN response to his decision to recognize Jerusalem as Israel’s capital intensified his skepticism about UN-managed foreign aid.

On December 21, 2017, 15 days after the Jerusalem embassy decision, the UN General Assembly voted 128–9 to condemn the president’s action. Notably, 56 countries either abstained or chose to be absent. Before the vote, Haley expressed the administration’s unhappiness with the UN’s treatment of the U.S., warning, “At the UN we’re always asked to do more and give more. So, when we make a decision, at the will of the American people, about where to locate our embassy, we don’t expect those we’ve helped to target us. On Thursday, there’ll be a vote criticizing our choice. The U.S. will be taking names.”

After the vote, she did more than take names. Our staff at the U.S. Mission in New York compiled the data on how often countries voted with us at the UN and compared that with how much foreign aid we sent to each of them. The disparity is remarkable. Just one of dozens of examples: South Africa receives half a billion dollars in U.S. aid annually but votes with us on key issues at the UN just 18 percent of the time. Haley brought this report to President Trump. He was outraged and determined to change our foreign-aid policy.

In this context, aid to the Palestinians came squarely into the crosshairs. There were few actors in the world with a grosser disparity between the size of American financial assistance they received and the extreme degree to which they rhetorically or otherwise opposed American policies. In this period, the Palestinian Authority was refusing even to speak or meet with any administration representative, yet between UNRWA and direct aid, we were sending them well over half a billion dollars.

Furthermore, the U.S. provided far more support to UNRWA than did other countries. Since UNRWA’s founding, the U.S. had donated $6 billion—vastly more than any other country. By 2017, we were giving UNRWA close to $400 million annually. Compare that with these amounts: Russia $0; China $300,000; Qatar $1 million; Turkey $1.5 million; Kuwait $5 million; France $15 million; UAE $17 million; United Kingdom $73 million; Saudi Arabia $148 million. The U.S. contribution was more than double that of the next largest donor and dwarfed that of wealthy countries that speak loudly of their solidarity with the Palestinian cause.

Despite this disparity, UNRWA still had strong defenders in the U.S. national-security bureaucracy. Many argued that this was as much of a security issue as a humanitarian one. Without U.S. support, the argument went, UNRWA schools would close and Palestinian youths would choose to become terrorists. Some Israeli officials shared that view.

In interagency debates, Haley argued that UNRWA officials routinely threatened school closings to protect its funding and avoid having to make hard budget or policy choices. We believed that if the U.S. cut funding, other countries would fill the financial gap. If not, the pressure to change would be beneficial. Further U.S. funding for UNRWA was frozen, pending the outcome of this debate within the administration.

As the debate proceeded, Secretary of State Rex Tillerson, the chief proponent of continued UNRWA support, made his own decision. As he had the power to do, he unilaterally authorized a $60 million U.S. donation to UNRWA—half the amount that had been previously pledged. The Washington Post headline on January 16, 2018, declared “Tillerson prevails over Haley in Palestinian funding debate.” UNRWA defenders in our government felt they’d won a victory. In fact, they had sealed the fate of their position.

In the Palestinian territories, the reaction on the ground to this U.S. “cut” was violent protest. How dare the Americans provide “only” $60 million? It was apparently lost on the protestors that, at the time, our $60 million still made the U.S. the single largest UNRWA donor so far that year. UNRWA staff members joined these protests, and pro-UNRWA advocacy organizations blamed the U.S. “cut” for Hamas-orchestrated violence in Gaza.

I phoned Commissioner Krahenbuhl and explained that such ingratitude toward his largest donor was jeopardizing further U.S. funding. He said he understood but was unable or unwilling to change course.

On August 31, 2018, the State Department announced the end of U.S. funding of UNRWA. In the end, not a single UNRWA school closed for a single day, and other countries did fill the financial gap left by the U.S. withdrawal. That was bad news and good news. It was bad that UNRWA was not subjected to enough pressure to reform. But it was good that the U.S. was no longer financing the agency, and that we had tested and disproven the long-standing contention that an American-aid cut would create a humanitarian or security crisis.

Challenging long-held but false beliefs was also the result of the administration’s biggest move in Israel–Palestinian affairs in its first two years in office: the aforementioned recognition of Jerusalem as Israel’s capital. The decision to move the U.S. Embassy from Tel Aviv to Jerusalem was controversial, inside the Trump National Security Council, as well as around the world.

The internal debate was reminiscent of the drama surrounding President Truman’s recognition of Israel’s statehood in 1948. Back then, the State and Defense Departments, and our intelligence agencies, opposed recognizing Israeli independence, primarily out of concern about hostile reaction in the Arab world. Now, in 2017, the same departments and agencies made the same case using the same arguments against recognizing Jerusalem as Israel’s capital.

While President Truman was largely alone in his view, President Trump had supportive team members in Mike Pence, Nikki Haley, and Ambassador David Friedman. They pushed back effectively against the arguments of State, Defense, and the intelligence agencies. Trump heard both sides and made his decision.

For decades, U.S. presidents were intimidated by the argument that recognizing Jerusalem as Israel’s capital would trigger violent explosions throughout the Muslim world. Trump and key colleagues doubted this, and they turned out to be right. Violent reaction in the Palestinian territories was limited, and there was virtually none elsewhere in Arab and Islamic countries.

In international relations, challenging longstanding beliefs often frightens those who embrace conventional wisdom. This embrace makes such beliefs conventional, but it does not always make them wise.

In her speeches, votes, and actions at the UN and in Washington, Nikki Haley helped usher in a new era in U.S. policy toward the Arab–Israeli conflict. She upheld the prediction she made after her first UN Security Council meeting on the Middle East: “I am here to say the United States will not turn a blind eye to this anymore. I am here to emphasize that the United States is determined to stand up to the UN’s anti-Israel bias.”

It’s a new era because Haley challenged and disproved some important basic assumptions about Middle East policy. It turns out that the United States can support Israel strongly and still work closely with Arab states to promote common interests such as opposing Iranian threats. The Arab street is not narrowly Israel-minded and is not as volatile as long believed. The sky won’t fall if the U.S. stops funding UN sacred cows such as UNRWA. Even if future U.S. administrations revert back to the policies of the past, these old assumptions will remain disproven. That is a valuable accomplishment that will last long after Nikki Haley’s UN tenure.