Cairo and Ankara have been on opposite sides for much of the last eight years. Ankara saw the rise of President Abdel Fattah Al-Sisi to power in 2013 and the imprisonment of its ally, former President Mohamed Morsi, as a blatant coup against the democratically-elected president in Egypt. An angered Turkish President Recep Tayyip Erdogan accused the Egyptian government of killing Morsi after he passed away in jail on 19 June, 2019.
President Al-Sisi, on the other hand, viewed Turkey's unfriendly rhetoric and negative media campaign towards him within the larger regional context of vying for power and influence. Erdogan believed that the Egyptian military, led by Al-Sisi, forced Ankara's regional political ally, the Muslim Brotherhood, out of power, despite winning the elections in 2012. The Turkish leader is regionally seen as the leader of political Islam in the area, and he is also a source of inspiration for all Muslim Brotherhood parties in Egypt, Libya and beyond.
Libya, Egypt's western neighbour, became the focus of conflict for regional dominance and influence between the two regional giants, Turkey and Egypt. Ankara supported Tripoli's former government, while Cairo supported the self-styled, renegade Field Marshal Khalifa Haftar. When he launched his April 2019 attack to take Tripoli, Ankara and Tripoli signed a security deal and maritime border demarcation agreement. This further angered Egypt and pushed it to intensify its support for Haftar.
Eventually, Haftar lost the war in June 2020, thanks to Ankara's support for his enemies. Besides its regular troops, Turkey provided Tripoli with thousands of Syrian mercenaries to counter Haftar's forces, who are also being supported by Russian mercenaries. After Haftar's forces were chased to their current positions around Sirte-Jufra, President Al-Sisi drew his "red line" around the region of Libya not far from its vast oil and gas fields – another major cause of potential conflict between Ankara and Cairo.
By the time the new Libyan Government of National Unity (GNU) came to power on 15 March, Ankara and Cairo had already secretly been talking. The two regional centres of power appear to have, at last, realised that their confrontation at this point is harmful to both. They also sensed that their rivalry is likely to negatively impact the situation in Libya. Ankara and Cairo stand to lose from the prolonged civil strife in Libya, while stable Libya presents enormous economic and security benefits to Cairo in particular.
The first diplomatic contact between Cairo and Ankara came from Turkey last February, and the following month saw the first public sign of diplomatic rapprochement. Then, the first Turkish delegation to visit Cairo in eight years, headed by Deputy Foreign Minister Sedat Onal, arrived in Cairo for talks on 5 May.
It is too early to say whether the thaw in ties between the two countries will overcome their differences. They must settle some challenging differences over issues of regional and domestic concerns to both capitals. Ankara started the positive gesture by turning down Egyptian opposition TV channels based in Istanbul and Ankara.
The significant areas of conflict still to be dealt with by both sides include regional trade and security, energy exploration in the eastern Mediterranean and sea border demarcation and conflict in Libya.
Tripoli's new government knows that it has to keep both Cairo and Ankara talking in order for it to proceed with its domestic agenda, including the national presidential and legislative elections scheduled for 24 December. This explains why Cairo and Ankara were the first two capitals visited by Prime Minister Abdul Hamid Dbeibeh immediately after taking office. On 21 April, Tripoli hosted a large Egyptian delegation headed by Prime Minister Mostafa Madbouly. The two countries signed a number of memoranda of understanding (MoU) in civil aviation, economics and telecommunications.
Turkey still has troops and thousands of Syrian mercenaries inside Libya, and Egypt would like to see this military presence end as soon as possible. While another round of fighting between the Libyan protagonists is unlikely, it remains a serious possibility.
In recent weeks, Libya's first female Foreign Minister Najla Mangoush has been calling on all foreign forces, including Turkish troops, to leave Libya. However, Ankara seems determined to keep its troops in Libya for the long run, and is unlikely to accept any notion of departing. If Ankara ultimately decides to leave Libya, it would not do so unless it obtains assurances from Cairo that the latter's support for Haftar is frozen. Tripoli and Ankara are bound by their November 2019 security deal giving Turkey the right to station troops in Libya. Cairo does not have many options but diplomacy to counter whatever it perceives as the negative consequences of such a security deal between Libya and Turkey.
What is not clear, and still has the potential to poison the Ankara-Cairo détente, is what will happen in Libya with regards to two things: security and the planned December elections. Egypt's ally Haftar is still around, however, without any official role in the new government in Tripoli. Yet, he still has the power to disrupt any political arrangements that he does not like. Ankara does not trust Haftar, nor his Russian allies – Russia's Wagner Group still has thousands of mercenaries in Libya supporting Haftar. Cairo, on the other hand, does not want renewed fighting in Libya, nor does it want a long-term Turkish military presence on Libyan soil.
With the current state of relations, the only sound outcome appears to be a zero-sum game in which Cairo wins, but only if Ankara loses and vice versa. While this is not entirely untrue, the role of diplomacy is to change the equation into a win-win game, not only for Ankara and Cairo, but for Tripoli too. If peace does not prevail in Libya, then all three capitals stand to lose.
The views expressed in this article belong to the author and do not necessarily reflect the editorial policy of Middle East Monitor.