The chaos in the Middle East has tested many relationships, not least the one between Egypt and Turkey. Shortly after the fall of Hosni Mubarak in 2011, Turkey became one of Egypt’s chief regional supporters. When the new president, Mohammad Morsi, was himself pushed out of office in 2013, Turkey shifted course. With General Abdel Fattah el-Sisi in power in Egypt, Turkey quickly became one of the country’s main adversaries in the Levant.

In August 2013, Turkey asked the UN Security Council to impose sanctions on Sisi. The next year, Egypt openly lobbied against Turkish candidacy to obtain a seat at the UN Security Council. Turkish President Recep Tayyip Erdogan also told Al Jazeera that his government “does not accept the [Sisi] regime that has undertaken a military coup.” He has also called Sisi an “illegitimate tyrant.”

Things between Egypt and Turkey have deteriorated still further in the wake of Egypt’s decision to launch airstrikes against the Islamic State of Iraq and al-Sham (ISIS) targets in Darna, Libya on February 16. The internationally recognized Libyan government and military in Tobruk supported the move, but factions, many of them Islamist, that have taken over Tripoli under the name New General National Congress (NGNC) were strongly opposed. Turkey has loaned NGNC a measure of diplomatic support by refusing to recognize the official Libyan government. For its part, Ankara condemned the airstrikes, saying “These attacks deepen the existing problems in Libya and the atmosphere of conflict and scupper efforts to resolve the crisis by peaceful means.” The United States, meanwhile, has neither applauded nor criticized the strikes.

In the immediate term, it seems likely that the regional rivalry between Egypt and Turkey will exacerbate the Libyan civil war. Further out, it could throw the whole region in to worse chaos.

BITTER FRENEMIES

Egypt and Turkey are the two largest Muslim-majority countries in the Eastern Mediterranean. Both see themselves as regional powers, and now, as the leaders of Sunni Islam. The tensions between them date back to the days of the Ottoman Empire, of which Egypt was a province until 1867 when it became semi-independent.

Egypt was always difficult for the Ottomans to control; although it was run by a governor appointed from Istanbul and paid taxes to the Sultans, the country along the Nile Valley enjoyed de-facto autonomy for much of the Ottoman rule. Egypt retained so much power that in the nineteenth century, that it even tried to take over the Ottoman Empire. In the 1830s, under the leadership of Mohammed Ali Pasha, the Albanian-born Ottoman governor of Egypt, and his son, an army commander, an Egyptian force conquered Palestine and Syria and threatened to overthrow the Ottoman Sultan. Indeed, Ibrahim Pasha penetrated deep into Anatolia, reaching the city of Kutahya, 200 miles from Istanbul. Only the intervention of the United Kingdom and France saved the Sultan’s throne and contained the Egyptian threat (although Mohammed Ali’s descendants became Egypt’s royal family). After the uprising, the British became the dominant players in Egypt and eventually severed it from the Ottoman Empire during World War I. With the collapse of the Ottoman Empire, the Turkish Republic looked west to Europe and the Aegean, not east to Egypt and the Arab world, and so the two countries went their separate ways. Many of adversaries of Kemal Ataturk, the founder of the Turkish Republic, including the poet Mehmet Akif Ersoy, took refuge in Egypt to escape Ataturk’s secularizing reforms. They turned Cairo into a hub of anti-Turkish activities in the interwar period.

The overthrow of the Egyptian monarchy in 1953 soured Turkish–Egyptian relations further. The ouster of King Farouk and the Ottoman-Turkish-sourced elite that still ran the country angered Ankara. And when Egypt’s new ruler, Gamal Abdel Nasser, sided with the Soviets in the Cold War, it only deepened the chasm between Ankara and Cairo. Ankara had entered NATO a year earlier and took its role as a pillar of Western power in the Middle East seriously.

In the 1970s, Egypt made a pro-U.S. turn under President Anwar Sadat. In the 1980s, Turkey made its own pro-Middle East pivot under Prime Minister Turgut Ozal. But rather than facilitating warm relations between the two countries, these developments only exposed their competition over the Eastern Mediterranean. For instance, Turkey was disappointed that Egypt did not support Ankara on the Cyprus issues, and Cairo, for its part, was upset by Turkey’s close partnership with Israel, which outshone Egyptian–Israeli ties.

COOLING OFF

The cordial competition lasted through the end of the Cold War. Then came Erdogan. When his Justice and Development Party (AKP) took power in Ankara in 2002, Turkey launched an aggressive pro-Middle East policy, abandoning Ataturk’s pro-Europe orientation. Ankara interjected itself in the Israeli–Palestinian conflict. It also built ties with various Muslim Brotherhood-affiliated parties in the Middle East, from Hamas to the Brotherhood itself in Libya and Egypt. Mubarak, Egypt’s ruler at the time, took issue with Ankara’s newfound activism in the Middle East, which he saw as coming at the expense of Egyptian prestige in the area, as well as intervention in Egypt’s domestic politics. But economics won out. Between 2002 and 2013, trade between Egypt and Turkey increased from $301 million to $5 billion. Turkish Airlines, Turkey’s flagship carrier, added Alexandria, Hurghada, and Sharm al Sheikh to the list of its direct flights from Istanbul.

Ties between the two countries looked set to strengthen when Mubarak resigned in the face of mass protests in February 2011. Erdogan presented Turkey as a model of a modern Islamic democracy. When he visited Cairo in September 2011, Egyptian crowds greeted him as a hero. Large billboards featuring Erdogan’s face lined the highway from Cairo airport to the city’s downtown area. Egyptian newspapers at the time suggested that a new alignment with Turkey would put pressure on Israel, and Erdogan let it be known that he was considering a visit to Gaza as a signal of Turkish support for Hamas as much as for the Gazan population.

In the end, the Gaza visit did not take place, reportedly due to opposition from Egypt’s then-ruling Supreme Council of the Armed Forces. Although a comment by Erdogan urging Egyptians to adopt Turkish secularism generated considerable criticism among Egyptian Islamists, Erdogan’s appeal to Egyptians searching for a new approach to politics remained strong. Turkey’s economic success added to the attraction; although Egypt and Turkey have populations of roughly similar size, with Egypt’s estimated at about 88 million and Turkey’s at 78 million, Turkey’s per capita GDP, at about $18,500 well outstrips Egypt’s, estimated at $3,800.

ARAB UPRISING

By November 2013, however, the Turkish–Egyptian relationship was in tatters, as the Egyptian Ministry of Foreign Affairs summoned the once highly influential Turkish ambassador to inform him that he had 48 hours to leave the country. The rise and equally sudden fall of the Egyptian–Turkish relationship is directly tied to Erdogan’s support for the Muslim Brotherhood and his staunch opposition to military rule.

Morsi, a senior member of the Muslim Brotherhood’s Guidance Bureau, became Egypt’s president in June 2012. Morsi quickly reached out for Turkish support for his signature foreign policy initiative, creating a regional group focused on the Syria crisis that would include Turkey, Iran, and Saudi Arabia along with Egypt. The group floundered over Saudi refusal to engage the Iranians, but Morsi enjoyed strong Turkish backing. Erdogan visited Cairo a second time in November 2012, this time bringing a large delegation from the government and from the private sector. He delivered a speech at Cairo University in which he praised Morsi for his decision to withdraw Egypt’s ambassador from Israel as a result of Israeli air strikes on Gaza, and suggested that an Egyptian–Turkish alliance would ensure peace and stability in the Eastern Mediterranean, implying that such an alliance would constrain Israel’s ability to use force. Erdogan praised Egyptian youth activists for bringing down Mubarak’s “dictatorship” and proclaimed that “Egypt and Turkey are one hand,” a play on the slogan promoted by the Egyptian military that “the army and the people are one hand.”

Erdogan’s ambitions for a strategic partnership with Egypt, one in which Turkey would be the leading partner, ran aground as Morsi’s grip on power began to slip. Shortly after Erdogan’s Cairo University speech, Morsi issued a “constitutional declaration” that put his executive powers above judicial review and then rammed through a new constitution drafted largely by Islamists. Anti-Morsi and anti-Muslim Brotherhood demonstrations in Cairo became increasingly violent, and various attempts at a dialogue between Morsi and the various political parties collapsed. By the spring of 2013, the anti-Morsi Tamarod movement began organizing mass protests scheduled for June 30, the one-year anniversary of Morsi’s rule. As reports circulated that Morsi had tried to remove Sisi from his position as defense minister, Egypt’s military leadership issued warnings that the army might have to intervene to “prevent Egypt from entering a dark tunnel.”

Meanwhile, Western and Turkish efforts to help Morsi reach an agreement with the IMF also collapsed, and Morsi withdrew a series of reform measures only hours after his office had announced them. Turkey offered Egypt concessionary trade deals and promoted Turkish private investment, but Morsi’s administration appeared increasingly paralyzed. As the June 30 protests drew closer, Erdogan sent Turkey’s national intelligence chief, Hakan Fidan, to visit Morsi. Subsequent reports in both the Egyptian and Turkish media suggest that Fidan’s mission was to warn Morsi of an impending coup and perhaps even discuss how to head it off. Whatever the real substance of the visit, it was perceived by the Egyptian military and their civilian allies as final proof of Erdogan’s alignment with Morsi and the Muslim Brotherhood.

On July 3, 2013, Sisi announced that the army had removed Morsi from power in order to “save” Egypt from the specter of civil war. Turkey’s carefully cultivated relationship with the Egyptian leadership was over. Erdogan referred to Sisi as “a tyrant” and accused the interim Egyptian government of practicing “state terrorism.” Ankara, meanwhile, allowed pro-Muslim Brotherhood and anti-Sisi television stations to operate from Turkey.

Egyptian media retaliated, accusing Turkey of supporting the terrorist campaign against the Egyptian security services that broke out in the Sinai Peninsula following the army’s removal of Morsi from power. Turkey’s able ambassador to Cairo, Huseyin Avni Botsali, went from being embraced across the spectrum of Egyptian politics to facing anti-Turkish demonstrations at the gates of his residence. Turkey and Egypt cancelled plans to hold joint naval maneuvers in the Eastern Mediterranean, and finally, in November 2013, the Egyptian Foreign Ministry told Botsali to leave the country.

Since then, regional politics have become much more violent. In the summer of 2014, war broke out in Gaza. As U.S. Secretary of State John Kerry raced to broker a ceasefire, Turkey (and Qatar) and Egypt offered up competing peace plans. Egyptian officials complained to their U.S. counterparts that Turkey and Qatar were deliberately seeking to use Gaza to undermine Egyptian interests.

Then, in Libya, Egypt and the United Arab Emirates supported General Khalifa Haftar’s campaign against Islamist militias, which were reportedly backed by Turkey. In November 2014, Sisi even played the Cyprus card, holding a three-way summit with the Cypriot and Greek presidents to promote a deal to supply natural gas from undersea fields off the coast of Cyprus to Egypt. Sisi was almost certainly seeking to challenge Turkish power in the Eastern Mediterranean.

BAD BLOOD

Beyond the geopolitical, there are also personal issues at play. In the summer of 2013, just as Morsi faced a popular wave of resentment that eventually led to his ouster, Erdogan had to grapple with his own popular uprising in Turkey—the liberal Gezi Park movement. The Turkish leader responded with a violent crackdown. Erdogan is Turkey’s most powerful leader since the country became a multi-party democracy in 1950. Even so, the Turkish leader seems to fear that what had happened to Morsi could happen to him. As long as Erdogan is unable to come to terms with the new realities of Egyptian politics, Turkish–Egyptian ties cannot be normalized.

At the same time, Sisi sees Erdogan as a rival in Levant affairs and, more importantly, in politics. The Morsi-allied Turkish leader, has won four successive elections, three parliamentary and one presidential, positioning himself as the gold standard of Islamist politics in the Middle East. In Erdogan’s success, Sisi sees the personification of his political enemies. This suggests that Turkish–Egyptian ties are unlikely to recover in the near future, so long as Erdogan and Sisi are in power. Indeed, the two powers’ regional rivalry is likely to further feed conflicts ranging from Gaza to Cyprus to Iraq.