Turkish President Recep Tayyip Erdogan has warned Europe it could face new threats from terrorist organisations if Libya's UN-recognised government in Tripoli were to fall.
In the article, published on Saturday on the eve of a Libya peace conference in Berlin, Erdogan said the EU's failure to adequately support the Government of National Accord (GNA) would be "a betrayal of its own core values, including democracy and human rights".
The GNA led by Fayez al-Sarraj has been under attack since April from strongman Khalifa Haftar's forces based in the east of the country, with fighting killing over 280 civilians and 2,000 fighters.
"Europe will encounter a fresh set of problems and threats if Libya's legitimate government were to fall," Erdogan wrote.
"Terrorist organisations such as ISIS and Al-Qaeda, which suffered a military defeat in Syria and Iraq, will find a fertile ground to get back on their feet."
In a joint initiative, Turkey and Russia have brokered a ceasefire but Haftar walked away from talks in Moscow this week aimed at finalising the truce agreement.
A furious Erdogan has accused Haftar of fleeing Moscow and said he would "teach (him) a lesson" if he resumed fighting.
Erdogan's government backs Sarraj and the Turkish parliament earlier this month approved the deployment of troops to Libya after the signing of controversial security and maritime deals between Tripoli and Ankara.
"To leave Libya at the mercy of a warlord would be a mistake of historic proportions," he said, in a veiled reference to Haftar.
World powers are trying to mediate a lasting ceasefire at the international conference in Berlin on Sunday which the warring parties are expected to attend.
"We hope what comes out of Berlin is renewed demonstration of international unity in supporting the intra?Libyan political process, ending foreign interference, leading to full respect of the UN arms embargo," UN spokesman Stephane Dujarric said at a press briefing on Friday.
The conference will aim to agree six points -- including a permanent ceasefire, implementation of a much-violated UN arms embargo and a return to political efforts for peace.
Erdogan, who is also due to attend the Berlin talks, wrote in Politico that the Libyan civil war served as a "litmus test" for the EU to show whether its leaders would abdicate their responsibilities and watch the crisis uphold from the sidelines.
"The EU needs to show the world that it is a relevant actor in the international arena," he said.
"The upcoming peace conference in Berlin is a very significant step toward that goal. European leaders, however, ought to talk a little less and focus on taking concrete steps."
An interim truce that came into force in Libya last Sunday has mostly held, despite accusations of violations from Haftar's forces and the rival GNA.
The fighting has spurred a growing exodus of migrants and refugees, many embarking on rickety boats from Libya towards Europe.