Jerusalem (CNN) The two former spymasters sat an arm's length apart. Both appeared calm and relaxed, neither suspicious of the other. Occasionally, they laughed with the crowd gathered at a synagogue in New York's Upper East Side.

The panel discussion in October was about the future of the Middle East. At one end sat Efraim Halevy, who led Israel's Mossad at the turn of the century. Next to him was Prince Turki bin Faisal al Saud, who headed Saudi Arabia's intelligence agency for 24 years.

A few years ago, such a meeting would have seemed inconceivable. To this day, Israel and Saudi Arabia don't have diplomatic relations. Until recently, any ties between the two countries, if they existed, were never discussed openly.

Now, the dynamics of a changing Middle East have revealed an association built on mutual interests, namely countering Iran's growing influence in the region. For Israel and Saudi Arabia today, the enemy of my enemy is my friend.

Speaking to Israel Army Radio on Sunday, Minister of Energy Yuval Steinitz admitted what many had long suspected. "We have partially clandestine ties with many Muslim and Arab countries. It's the other side who is interested in hiding it," Steinitz said. "Our ties with the moderate Arab world assists us in blocking Iran."

Yuval Steinitz, Israel's Minister of Energy and water resources, speaks at a conference in Texas, in the United States, in 2016.

Finding common ground

Prince Faisal's visit to a New York synagogue was one of a growing number of public interactions between Israelis and Saudis. In January, Faisal met with former Israeli Foreign Minister Tzipi Livni on the sidelines of the World Economic Forum in Davos, Switzerland.

In the summer of 2016, retired Saudi General Anwar Eshki visited Jerusalem, meeting Israeli politicians while seeking to revive interest in an old peace initiative from 2002. At the heart of the visit was the two countries' mutual enemy: Iran.

"The Israeli-Palestinian conflict is not the source of terrorism, but it does create fertile ground for acts of terrorism in the region," Eshki was quoted as saying. "If the conflict is resolved, the countries that exploit the Palestinian issue, namely Iran, will no longer be able to capitalize on it."

Israeli Chief of Staff General Gadi Eizenkot attends a ceremony marking the 10th anniversary of the 2006 war between Israel and Hezbollah in Jerusalem.

Last week, Israel Defense Forces Chief of Staff Gadi Eizenkot gave his first-ever interview to Saudi media, speaking to Saudi news site Elaph. Eizenkot's intended audience may have been moderate Sunnis in the Gulf states; the interview was an attempt to establish common ground between Israel and the Arab world, and lay the groundwork for further relations, one tiny step at a time.

"I was in the meeting for chiefs of staff in Washington and when I heard what the Saudi representative said, I found that it is exactly what I think of regarding Iran and the necessity to confront it in the region and stop its expansion program," said Eizenkot, in what Israeli media called an unprecedented interview.

"We are ready to share information if necessary [with the Saudis]," Eizenkot continued. "There are many mutual interests between us."

In a speech at Israel's Foreign Ministry in September, Prime Minister Benjamin Netanyahu (who also serves as the country's Foreign Minister), said: "There is cooperation in various ways, on various levels, but it is not yet out in the open. But what is not yet out in the open is much greater than in any other period in Israeli history. This is a major change. The entire world is changing."

The groundwork for peace

Forty years ago this month, Egyptian President Anwar Sadat became the first Arab leader to officially visit Israel, speaking before the Knesset about the need for peace. His visit paved the way for a peace agreement between Israel and Egypt in 1979, making Egypt the first Arab country to recognize Israel.

Egyptian President Anwar Sadat, left, greets then-Israeli opposition leader Shimon Peres in May 1979 in the southern Israeli city of Beersheva.

In commemorating the visit, Israeli Defense Minister Avigdor Liberman tweeted last week, "Anwar Sadat is a true leader that went against the flow and paved the way for additional Arab leaders to recognize the importance of strategic ties with the State of Israel. Forty years after the historic landing in Israel, I call on regional leaders to follow President Sadat, to come to Jerusalem, and to turn a new page, not only in relations with Israel and the Arab world, but with the whole region."

US President Jimmy Carter (C) congratulates Egyptian President Anwar al-Sadat (L) and Israeli Premier Menachem Begin (R) in March 1979 after the signature of their historic peace treaty.

It would be another 15 years before the next Arab country signed a peace treaty with Israel. In 1994, Jordan's King Hussein and Israel's Prime Minister Yitzhak Rabin shook hands after signing the accord, with US President Bill Clinton looking on.

Jordan's King Hussein and Israeli Prime Minister Yitzhak Rabin shake hands, watched by US President Bill Clinton, in 1994.

Since then, Israel's relations with the Arab world have developed slowly. Israel and Qatar maintained modest trade relations until 2013, according to Israel's Ministry of Foreign Affairs, and Israel has a mission in Abu Dhabi to cooperate with the United Nations' International Renewable Energy Agency.

"Cooperation in different ways has been happening between Israel and different [Gulf Cooperation Council] states not for the past year, but for the past decade, including with Qatar but with pretty much everyone, albeit on different files," said H. A. Hellyer, a nonresident senior fellow at the Rafik Hariri Center for the Middle East at the Atlantic Council.

Further development of Israel's relations with the Arab world is contingent upon progress on the Palestinian front. This is especially true with Saudi Arabia, where the Israeli-Palestinian conflict remains an important issue.

"An open alliance would be politically awkward for Riyadh owing to the failure to resolve the Palestine question and put an end to the Israeli occupation and siege," Hellyer said, "but no one should underestimate how much antagonism to Iran animates Riyadh."

Strategic concerns and mutual benefits

With official diplomatic relations static, opposition to Iran and its proxies has become the mutual interest for ties to develop privately.

The sudden resignation of Lebanese Prime Minister Saad Hariri in Riyadh earlier this month -- before his about-face -- fueled speculation by Israeli analysts that the Saudis were trying to maneuver Israel into another war with Hezbollah, the Iranian-backed Shia militant group with whom Hariri shares power in Lebanon.

Lebanese Prime Minister Saad Hariri is pictured in Paris on November 18, two weeks after he announced his resignation, since suspended.

With Hariri gone, Hezbollah would shoulder the blame for Lebanese political dysfunction, the theory goes, and could initiate a war with the "Zionist entity" in order to shore up domestic support.

Last week, Adel bin Ahmad al-Jubeir, Saudi Arabia's Foreign Minister, said: "Hezbollah is a terror organization. There is no peace in Lebanon unless it's disarmed." Those words could have come from Israel's leaders, who see Hezbollah -- an Iranian proxy -- as a serious, possibly strategic, threat to Israel.

Saudi Arabia's Foreign Minister Adel bin Ahmad al-Jubeir attends a meeting of Arab foreign ministers in March this year.

"We do have unprecedented common ground," said Amos Gilad, the former director of the Political-Military Affairs Bureau at Israel's Ministry of Defense.

"The Arabs used to be our worst enemies and now we are living in spring -- not the Arab Spring that is negative -- but a real spring with them based on common enemies, threats and unprecedented readiness of Israel to cooperate against all dangers, and they are very valuable to national security and the whole area's stability."

Israel and Hezbollah last fought a war in 2006. The 34-day conflict was indecisive, ending in a United Nations-brokered ceasefire. Israel is not eager to rush into another war with a stronger Hezbollah, battle-tested from years of fighting in Syria.

A man passes a mural painted on a wall in southern Beirut in 2006.

In his interview with the Saudi news site, Eizenkot dismissed speculation that Israel wanted a war with its northern neighbor. "We have no intention of attacking Hezbollah in Lebanon and bring about a war," Eizenkot said. "However, we will not accept a strategic threat to Israel."

For Israel, normalization with Saudi Arabia -- and subsequently the UAE, Bahrain and perhaps other regional Arab states -- would offer Israel more local trading partners and bolster the sliver of a country's security in the Middle East.

For the Saudis, official relations with Israel would give them an additional -- and powerful -- weapon in the struggle against their regional rival Iran, which has established an arc of influence from Tehran to Baghdad to Damascus to Beirut. Normalization would allow Saudi Arabia to tap into Israel's military and cyber expertise, presenting a more united front to counter Iran.

But normalization will require Israel to make a move that it has so far been unwilling to make: an acceptance of the 2002 Saudi Initiative or other concessions on a process to end the Israeli-Palestinian conflict.

Israeli soldiers are seen in a trench during the 1967 Six-Day War.

Saudi initiative

For years, Saudi Arabia has pushed its 2002 peace initiative as the basis for an end to the conflict and a full normalization of relations with the Arab states. The plan called for Israel to withdraw from territories occupied following the 1967 Six-Day War and accept the establishment of an independent Palestinian state in exchange for diplomatic relations with the region's Arab countries.

Despite its widespread international recognition as -- at the very least -- a basis for negotiations, Israel has never accepted the initiative.

If once it was Egypt that seemed the critical third-party in an Israeli-Palestinian peace deal, the focus has shifted to Riyadh, a point not lost on US President Donald Trump as his administration tries to restart negotiations. Trump's special envoy for international negotiations, Jason Greenblatt, and son-in-law Jared Kushner, who have led the team pursuing what the president has called "the ultimate deal," have visited the region -- and the Saudis -- multiple times to lay the groundwork for a peace process.

US special envoy Jason Greenblatt attends the launch of a project to improve access to wastewater treatment and water for Palestinian farmers in the city of Jericho, in the West Bank, in October.

"While there are no diplomatic ties with Tel Aviv, Saudi Arabia remains the only hope for a lasting regional peace given its political and religious weight," said Faisal J. Abbas, editor-in-chief of the Arab News, the first Saudi English-language newspaper.

Painting Saudi as a potential neutral mediator, Abbas pointed to "the fact that, unlike Qatar for example, [Saudi Arabia] has not supported Hamas, which has fired missiles into civilian areas" and doesn't have "a slogan cursing Jews or wishing death to Israelis like the Iranians and their Houthi and Hezbollah agents."

There is a sharp line being drawn through today's Middle East. On one side, Iran stands together with Hezbollah in Lebanon and the Houthi rebels in Yemen, joined by Syrian President Bashar al-Assad.

On the other side, Saudi Arabia is allied with the other Sunni Arab countries in the region. Next to them stands Israel, no longer an enemy, but not quite a friend.