Turkish President Recep Tayyip Erdogan left no doubt about his government’s commitment to Libya last month, pulling out all the stops to welcome Prime Minister Abdul Hamid Dbeibah and 14 of his ministers to Ankara. Following the March change in government in Tripoli, the two countries committed to joint projects in energy, reconstruction and beyond, solidifying Turkey’s role in post-conflict Libya. Ankara's involvement in Libya's civil war began to emerge in January 2018, when the Greek coastguard impounded a shipping vessel carrying weapons and explosives from Turkey to the Libyan port of Misrata, an apparent effort by the government to <a href="https://www.thenationalnews.com/world/mena/as-turkey-admits-to-arming-libya-militants-ankara-s-open-support-is-causing-conflict-1.881758" target="_blank">support Islamist-linked rebels</a> in violation of a UN embargo. When a Turkish ship carrying thousands of guns was <a href="https://www.thenationalnews.com/world/mena/turkey-to-open-joint-investigation-with-libya-on-smuggled-arms-1.805615" target="_blank">seized in Libya's Khoms port</a> later that year, the Turkish government's backing of the Tripoli-based Government of National Accord (GNA) had been exposed. News outlets in neighbouring Egypt said Turkey was sponsoring terrorism and posed a direct threat to Egyptian security. The UN said Turkey’s involvement was “extremely disconcerting” and a Libyan human rights group urged the UN to take action. Yet <a href="https://www.thenationalnews.com/world/mena/libya-s-tripoli-militias-boast-of-turkish-weapons-shipment-despite-un-embargo-1.863229" target="_blank">Ankara continued</a>, sending military equipment and advanced drones to support the GNA in the face of a major offensive launched by Field Marshal Khalifa Haftar's Libyan National Army in April 2019. That December, Turkey doubled down, signing a maritime deal with the GNA that vastly expanded its claims in the eastern Mediterranean and embarking on a full military intervention. Ankara sought to support the Islamist side and gain a foothold in the Maghreb, ensure the revival of some $20 billion in infrastructure deals first made with the ousted Qaddafi government and gain leverage in the eastern Mediterranean chase for natural gas. The <a href="https://www.thenationalnews.com/world/europe/eu-naval-manoeuvres-in-eastern-mediterranean-extremely-worrying-1.1061771" target="_blank">EU condemned</a> Turkey for its troop commitment. But the GNA stiffened – thanks in part to Ankara's military backing, which included thousands of <a href="https://www.thenationalnews.com/world/mena/turkey-sent-200-syrian-mercenaries-to-libya-in-past-week-says-syria-monitor-1.1148518" target="_blank">Syrian mercenaries</a> – and held off Field Marshal Haftar's assault on Tripoli, eventually leading to the <a href="https://www.thenationalnews.com/world/mena/un-says-libya-sides-reach-permanent-ceasefire-deal-1.1098358" target="_blank">October 2020 ceasefire</a>. Some of the other countries involved in the conflict have also violated the UN embargo. But the focus here is on Turkey because it was Ankara’s intervention that appeared to change the course of events. And Turkey is now well placed to help stabilise the country in the lead-up to December elections. If it plays its cards right, Ankara could also advance its efforts to boost long-troubled ties with regional and global powers. In January, a top US diplomat urged Turkey and other countries to cease all military operations in Libya and withdraw their troops to ensure security for the December vote. The UN Security Council and Libyan Foreign Minister Najla El Mangoush have also urged foreign troops to depart. Turkey has held its ground, arguing that its troops came at the request of the Libyan government and are fulfilling a commitment to improve security. Yet the coming weeks present the perfect opportunity for Turkey to withdraw the majority of its forces with a minimal loss of influence. For starters, a significant Turkish drawdown could be given the condition that the new government agrees to preserve the maritime borders deal and reaffirm its commitment to renew the lucrative Turkish contracts made under previous regimes. Turkey is already among the likeliest beneficiaries of a revived Libyan economy, but it still seeks assurances that Tripoli will back its stance in the eastern Mediterranean. In return, Turkish military advisers could remain and continue the significant training they have already been doing with the Libyan military, police and security services, while Turkish technocrats would help advise nascent government bodies. This institutional role could boost security in Libya and help to ensure the success of Turkish business contracts. It could also lead to another opportunity. In recent weeks, the Biden administration has launched an effort to reopen its Libyan embassy seven years after its closure. Last week, US acting assistant secretary of state Joey Hood became the highest-ranking US diplomat to visit Libya since 2014, while a State Department spokesman reiterated the need for foreign interventions to end and the security situation to improve. The EU reopened its Tripoli mission earlier this month, and other states have returned a diplomatic presence to Libya as well, despite lingering security risks. A March report by the UN described Libya as nearly lawless and over-run with foreign weaponry, with reports of widespread human rights violations and mercenaries from Chad, Sudan and Syria battling locals and regional militias. A <a href="https://www.thenationalnews.com/world/the-americas/congress-advances-libya-sanctions-bill-to-bolster-peace-process-1.1113939" target="_blank">bill in the US House</a> that would impose sanctions on entities that violate the UN arms embargo on Libya has received bilateral support. So a Turkish withdrawal would satisfy US demands and potentially prod other external actors to follow suit. In addition, Turkey could leverage its significant influence within Libya’s government – which has urged Washington to expedite its embassy reopening – to ease a US return, strengthening the American position in North Africa. This would align with a US-Turkey commitment last year to work more closely in Libya. For historical, security and commercial reasons, the EU has long had a sizeable role in North Africa. EU advisers have for years been training the Libyan coastguard to patrol its waters and stem the flow of illegal migrants. Already this year <a href="https://www.thenationalnews.com/world/europe/arrivals-of-migrants-on-italian-island-of-lampedusa-swell-past-2-100-in-24-hours-1.1220801" target="_blank">more than 13,000 migrants</a> have reached Italy from North Africa. In recent weeks, Turkey has begun working with the Libyan coastguard to intercept migrant boats headed for Europe, including a dinghy carrying nearly 100 people earlier this month. Turkey, a member of Nato, could maintain a naval presence in Khoms, as it has reportedly sought to do, and join forces with the EU to help Libya stop migrants, encouraging improved ties. "Turkey aims to support the Frontex EU border security," Turkish presidential adviser Mesut Casin said last week, adding that Italy and Malta backed Turkey's efforts off the Libyan coast. A UN report last week faulted the EU and Libya for migrant deaths in the central Mediterranean. UN human rights chief Michelle Bachelet <a href="https://www.thenationalnews.com/mena/horror-as-bodies-of-young-migrants-wash-up-on-libyan-beach-1.1230164" target="_blank">urged the EU</a> to increase migrant protections, so Brussels should welcome Ankara's assistance. Finally, Turkey has in recent weeks sought rapprochement with Egypt, after years of deep freeze. During <a href="https://www.thenationalnews.com/mena/egypt/egypt-and-turkey-conclude-frank-talks-in-cairo-1.1218155" target="_blank">bilateral talks in Cairo</a> early this month, Egyptian officials reportedly put a Turkish withdrawal from Libya at the top of the agenda. Thus, Turkey pulling out most of its troops – and, importantly, all of its Syrian mercenaries – would go a long way toward smoothing ties with Egypt. Turkey is unlikely to pull out fully, or too quickly. Last month, Mr Dbeibah cancelled a trip to eastern Libya after Field Marshal Haftar’s forces refused to hand over Benghazi airport security to the prime minister’s team – an incident that for Ankara will have underscored the continued need for some Turkish assistance to Mr Dbeibah. But in two weeks, Nato’s 30 members will gather at the alliance’s headquarters in Brussels. That summit offers Turkey the perfect opportunity to cozy up to its allies by announcing a major shift in its role in Libya, from primarily military to chiefly economic and political, and from focusing on relationships with Islamists and militia leaders to building institutions. I do not expect it to happen, but that does not mean it would be any less welcome, to Libya and the international community. “A very different world awaits Libya with elections at the end of 2021,” Turkish Industry and Technology Minister Mustafa Varank said last month. “In the new era, we must unlock Libya’s potential together.” <em>David Lepeska is a Turkish and Eastern Mediterranean affairs columnist for The National</em>