In the Middle East, long-established alliances are shifting dramatically. As one political leader in the region said to me recently: "The ground is shaking under our feet and we must keep all our options open." Three major events over the past three months have destabilised the old order: a military coup against Mohamed Morsi's government in Egypt; the Russian-American agreement to destroy Syria's chemical weapons; and a phone call between Obama and the new Iranian president Hassan Rouhani.

But first: what did the old order look like? Before Hosni Mubarak's regime was overthrown in Egypt, the Middle East was split into two main axes. The so-called axis of moderation – Egypt, Saudi Arabia, Jordan, UAE and Kuwait – was aligned with the west, supported the Palestinian National Authority and encouraged a political settlement with Israel.

The axis of resistance – Iran, Syria and the political movements of Hamas and Hezbollah – had a strained relationship with the west and considered a political settlement with Israel as a surrender. Qatar and Turkey stood close to this axis, maintaining good relations with the axis of moderation.

The fall of Mubarak's regime in January 2011 removed Egypt from the axis of moderation and triggered the current regional turmoil. The Syrian uprising against the Bashar al-Assad regime drove the Hamas leadership out of Syria, and out of the axis of resistance. Turkey and Qatar also moved further away after both expressing public support for the Syrian rebels.

In this way, the axis of resistance was transformed into an axis of Iranian-Shia power, extending from Tehran to Nouri al-Maliki's government in Iraq and Hezbollah in Lebanon – a resilient axis united by support for the Assad regime.

After Morsi's election, Turkey and Qatar lent Egypt financial and political support, forming a new strategic alliance. Thus the coup that overthrew Morsi in July was a strategic earthquake. But it was welcomed by what was left of the axis of moderation: Saudi Arabia, UAE, Kuwait, and Jordan. The Saudi king congratulated the interim president of Egypt and, with Kuwait and the UAE, offered him a package of aid exceeding $12bn, and King Abdullah II of Jordan was the first Arab leader to visit Cairo after the coup. However, Qatar and Turkey condemned the coup. Iran, though not sorry to see Morsi go given his support for the Syrian revolution, was concerned to see Egypt strongly aligned once more with Iran's enemies.

The aftershocks of the coup continue to affect the region. The countries supporting it had hoped the military would enforce its rule in a matter of weeks, but they miscalculated: three months on the Egyptian scene hasn't settled down. There are still constant marches and protests, as well as an imposed evening curfew. Military and security measures have been taken against the Sinai and several cities and villages opposing the coup, and are driving the country into a state of economic paralysis.

On a regional level, there were other miscalculations, too. The new axis of moderation tried to topple the Islamist movements in Tunisia and Libya, while the Egyptian army began destroying the tunnels linking Gaza and Sinai as well as launching an extensive campaign against Hamas with the hope of ending its control of the Gaza Strip. At the same time, the new axis of moderation also strained its relationship with Turkey, one of the most strategically important countries in the region.

However, the greatest miscalculation the new axis made was its evaluation of the Russian and American position on Syria. This axis hoped Basher al-Assad's regime would be quickly eliminated and replaced with a regime aligned with the axis of moderation, while also excluding jihadists from the scene. Saudi and UAE diplomacy supported an American military strike against Assad. They communicated with Russia to give assurances and incentives to ensure that the Russians would refrain from effective rejection of any strikes. However, the Russian-American deal to disarm Syria's chemical weapons was a surprise. This was then followed by the developing closeness between Iran and both the US and Britain, which further complicated the situation and derailed the aims of the axis of moderation.

The restructuring of regional alliances is still ongoing. The two countries that would benefit most from being politically close would be Turkey and Iran. Iran, burdened by an economic blockade and on the verge of talks with the west, has an interest in the Iraqi and Syrian crises being resolved in a manner that would guarantee the preservation of its power while bringing stability to the region.

Meanwhile, Turkey also has an interest in putting an end to the bloodshed in Syria and Iraq because of the detrimental impact the conflicts are having on Turkey's own stability and economic development. In addition, Turkey's relationship with the axis of moderation has deteriorated since the coup in Egypt, and it needs to make diplomatic moves to revive its regional influence.

However, the transformations in the region are expected not only to affect the position of countries, but that of the Islamist movements as well. In particular it will be interesting to see how Hamas re-evaluates its regional relations and whether the targeting of the movement in Gaza will drive it to restore close relations with Iran.

The region as a whole has suffered from conflict between the two axes for years, and this has led to civil wars and sectarian conflict. It is now clear that the struggle in Syria has reached a critical point for both sides, and there will be no solution unless Iranians, Turks and Arabs can work together. As for Iraq, its legislative elections will be held in a few months. Sectarian polarisation in the country is claiming hundreds of lives on a monthly basis. Without reconciling Sunnis, Shias and Kurds, Iraq too is heading for more violence.

Conflicting axes cannot achieve stability in the region; only co-operative efforts of all the parties and countries involved can hope to do that. Today this all seems a distant hope, and the region may have to experience more turmoil and chaos before this fact is accepted.