Leadership is about knowing your objectives and implementing the tactics to get there. Leadership is also about choices and consequences.

November 2017 marks the 40th anniversary of Egyptian President Anwar Sadat’s visit to Jerusalem and his historic speech to the Israeli parliament. Those were heady days in Israel and elsewhere. There was a genuine hope for a broad Middle East peace.

The Jerusalem visit and speech were means to ends, not ends in themselves. Sadat saw negotiations as the means to regain Sinai from Israel. His long-term objective was to better the Egyptian economy and improve the lives of average Egyptians. He wanted to carve a noble place for himself ahead of his high-profile, charismatic predecessor, Gamel Abdul Nasser.

Nasser was the pan-Arab leader who chose Arab socialism to drive his economy. He had closely aligned Egypt with Moscow during the Cold War and proclaimed the liberation of Palestine to be his central cause. In leading Egypt to a crushing defeat against Israel in the June 1967 war, Nasser suffered the Sinai Peninsula’s loss and incurred a black mark on Egyptian national honor.

What is certain: Sadat negotiated with Israel because he needed to do so, not because he had some hidden love for Zionism. Fortunately for Sadat, he had willing Israeli leaders in Golda Meir, Yitzhak Rabin, Menachem Begin and Moshe Dayan who wanted to end the war with Egypt; they each sought creative ways to reach interim agreements and ultimately a peace treaty with Israel’s most dangerous existential threat.

Sadat knew from the outset that the key to Egypt’s future could be found in Washington as banker and mediator. He abruptly moved away from Moscow, distanced himself from his immovable Arab colleagues, and put Egyptian population interests ahead of the Palestinian cause or the destruction of Israel.

By embarking on the October 1973 war, Sadat had a narrowly defined purpose. The previous April, he had sent his national security adviser to meet with Secretary of State Henry Kissinger and found the United States not interested in launching a negotiating initiative to have Sinai returned to Egyptian sovereignty.

Sadat gambled by going to war, but from the surprise attack on Israel, he created his own opening. Through the CIA in the first week of the war, he reportedly told Kissinger of his interest in negotiations. This was reaffirmed by a member of Kissinger’s State Department at the time, Joseph Sisco, who told me in a February 1992 interview that Sadat’s “decision to go to war was precisely to get what he wanted, a negotiation started with the Americans.”

After the October war, Sadat told his chief of staff, “Egypt was not making peace with Israel, but with the United States.” In Arabic, the Egyptian chief of staff told an Israeli counterpart at that time, “Halasna Filastin!” (We are finished with Palestine!)

Between 1973 and his assassination in 1981, Sadat made other bold moves to keep the engines of negotiations moving forward, including his trip to Jerusalem.

At the time of his death, Sadat’s tally sheet showed that he had successfully focused on Egypt first. Cairo had become Washington’s best Middle Eastern Arab friend, negotiated Israel’s withdrawal from Sinai, had Israeli settlements removed from Sinai, received large sums of American foreign aid, moved his economy slowly toward capitalism and entered a long-term military supply relationship with Washington.

The United States, of course, secured Egypt’s switch, perhaps the most important victory for Washington over Moscow in the Cold War. For his decision to move Egypt dramatically in other directions, Sadat paid with his life.

In the 1980s, Egypt was boycotted and severely rebuked by Arab leaders. PLO leader Abu Iyad said in January 1991, “The worst day in the life of every Palestinian was when Sadat went to Jerusalem as an Israeli flag flew over his head.”

And yet by 1991 the PLO itself had embraced the possibility of reaching an agreement with Israel.

November 2017 is also the 70th anniversary of the U.N. resolution that suggested the partition of Palestine into two states. One could ask how different the Middle East might have been if Arab states and the Palestinians had accepted the 1947 geopolitical realities of creating Jewish and Arab states alongside each other in Palestine.

Sadat proved that leadership is also about taking risks, being pragmatic, discarding crippling ideologies and looking over the horizon for the good of your people.

Ken Stein is the president of the Center for Israel Education (www.israeled.org), teaches at Emory University and is the author of “Heroic Diplomacy: Sadat, Kissinger, Carter, Begin and the Quest for Arab-Israeli Peace,” 1999.