The Middle East and the Gulf regions are about to sail into unchartered waters. On 14 July the P5+1 and Iran reached a milestone agreement on the Iranian nuclear programme after more than a year and a half of critical negotiations that bordered, several times, on stalling, and maybe failure. In the end, the collective political will of all concerned triumphed and a historic deal was signed in Vienna. The Joint Comprehensive Plan of Action, the agreement's official title, brings to an end one era and opens a completely new one in the Middle East and the Gulf. It also heralds a new chapter in relations between the superpowers and regional and Arab powers. In the meantime, the relative strengths of the various powers in the region, including Israel, will not remain unchanged. To understand the long-term implications of the Vienna agreement we have to go back to 1979. Why this particular year? I personally believe that the era that is about to end in the Middle East started then. The Iranian Revolution and US-Iranian relations played a great role in defining not only the patterns of alliances, but also the events that have occurred in the region throughout the last four decades. The signing of the peace treaty between Egypt and Israel on 26 March 1979 coincided with a major reordering of the regional balance of power to the detriment of Arab powers including Egypt. The Iranians, under Khomeini, successfully instrumentalised the Palestinian question as a mobilisation tool to widen the new revolutionary zeal in Iran across the Arab world and Muslim nations, and deepen Iranian influence in Arab countries with large Shia minorities, like Iraq, Lebanon, Syria, Bahrain and Yemen. Just to give one example of the new Iranian outreach in the heart of the Arab world, suffice to mention the creation of Hezbollah in Lebanon and the important role that it has played within Lebanon and beyond. Over the past four decades the overarching interest of the United States and its regional and Arab allies has been to contain Iran. This alliance sought to prevent Iran from obtaining the ultimate weapon, namely, the atomic bomb. US President Barack Obama, from day one in the Oval Office in January 2009, made matters clear when he said that as far as the Iranian nuclear question was concerned all options were on the table. He let it be known that his administration would favour the diplomatic option, but if this failed Washington would not hesitate to use force to prevent Iran from acquiring a nuclear arsenal. Of course Israel, under Netanyahu, was not thrilled with such a policy, and did all it could to derail it. The appearance of the Israeli prime minister in front of a joint session of US Congress on 4 March was meant to sabotage the P5+1 negotiations with Iran. Luckily, neither the hawks in Israel nor the hawks among Republicans in the US had their way. The Israeli government announced that it would not be bound by the Vienna agreement. This position should not be a surprise. The Likud government in Israel is, probably, a net loser. The trump card of this government was that Iran presented an existential threat to the existence of Israel, and on these grounds, it relegated peace with the Palestinians to the lower end of its priorities. If the Vienna agreement is fully implemented, international pressure on Israel will become more pronounced and determined to push it back to the negotiating table with the Palestinian Authority. Another Israeli concern is the coming of a new era in American-Iranian relations. Will the Vienna agreement open the way for the re-establishment of diplomatic relations between Washington and Tehran in the months to come, or before President Obama leaves office 18 months from now? Needless to say, the Obama administration keeps repeating that the security of Israel comes first in its strategy in the Middle East. But the return of Iran after the lifting of sanctions in January 2016, and official US recognition of such a return, is a strategic shift in the regional dynamics of the Middle East. Not only Israel is concerned by such shift, but also Turkey and Saudi Arabia. After the death of King Abdullah in January, Saudi policymakers and Saudi intellegentia broached the idea of a Sunni alliance to face the growing assertiveness of Tehran, especially after the advances of the Houthis in Yemen that prompted a swift Saudi reaction in March, with military strikes under the umbrella of the “Arab Coalition.” They reasoned that Egypt could become part of such an alliance of Sunni powers against the post-ViennaIran. I doubt that Egypt would ever accept to be a member in such an array of forces. First, Egyptian foreign policy has never been defined on religious grounds. Second, Egypt can never be in an alliance with the Turkey of Erdogan. In the meantime, it is much better for Egyptian regional interests to stay away from ad hoc alliances to face Iran. We should adopt a wait and see attitude towards the new regional realignment of forces, keep all our options open, and avoid becoming entangled in the shifting alliances that are sure to take place in the transitional era that has opened in the Middle East with the Vienna agreement. It goes without saying that the United States will become the arbiter of the new balance of power in the region. Egypt must make sure that this new balance of power does not undermine its core interests in security, stability and economic prosperity. Times are changing in the Middle East, with its mix of challenges and opportunities. Let us make sure that we will be able to overcome all challenges and maximise opportunities by staying away from alliances based on sect or religion. We should also adopt an aggressive foreign policy that aims to prevent the creation of such alliances. The Vienna agreement should usher in an era of cooperation that safeguards Arab and Palestinian interests. Iran should not become the enemy of the Arab world. But if Iran chooses to use this agreement as a cover for more intervention in Arab affairs, then the Arabs should join together to send a firm message to the Iranians that such intervention will not come to pass. The writer is a former assistant to the Egyptian foreign minister.