Turkish President Recep Tayyip Erdogan has warned Europe it could face new threats from "terrorist" groups if Libya's United Nations-recognised government in Tripoli were to fall, in an article published in Politico.

In the article released on Saturday, the eve of a Libya peace conference in Berlin, Erdogan said the European Union'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".

More:

"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 [ISIL] and al-Qaeda, which suffered a military defeat in Syria and Iraq, will find a fertile ground to get back on their feet," he added.

"Keeping in mind that Europe is less interested in providing military support to Libya, the obvious choice is to work with Turkey, which has already promised military assistance," Erdogan continued.

"We will train Libya's security forces and help them combat terrorism, human trafficking and other serious threats against international security," he added.

200116123456897

Renegade military commander Khalifa Haftar's eastern-based forces have been engaged in an offensive on Tripoli for more than nine months targeting the GNA led by Fayez al-Sarraj. The fighting has killed more than 2,000 people, including some 280 civilians, and displaced tens of thousands of others.

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 warned on Tuesday that Turkey will not refrain from "teaching a lesson" to Haftar's self-styled Libyan National Army (LNA) forces if their attacks against the GNA continue.

Both the LNA and GNA conditionally agreed to a truce brokered by Turkey and Russia last week, however, new fighting has been reported.

'Mistake of historic proportions'

Erdogan's government backs al-Sarraj and the Turkish parliament approved the deployment of troops to Libya earlier this month after the signing of controversial security and maritime deals between Tripoli and Ankara.

200106062845414

Sources told Al Jazeera about 180 Turkish forces are believed to already be in Libya acting as military advisers and trainers.

"So far, the Turkish military hasn't stated anything about the potential size of the deployment to Libya to support the GNA, but we're told the military will not be involved in combat," said Al Jazeera's Sinem Koseoglu, reporting from Istanbul.

"To leave Libya at the mercy of a warlord would be a mistake of historic proportions," Erdogan wrote in his article, in a veiled reference to Haftar.

His article comes a day before the key conference on the Libya crisis in Berlin, which is expected to be attended by representatives of Libya's warring sides and several world powers.

Germany's foreign minister, Heiko Maas, said Haftar supported the temporary ceasefire and was also willing to attend the conference, but it remains to be seen.