Fighters of a military battalion loyal to Libyan General Khalifa Haftar march during the morning assembly in Benghazi, Dec. 18.

Turkey is preparing to deploy troops and naval forces to support the internationally recognized Libyan government, joining a planned push by Ankara-backed Syrian rebels to defeat strongman Khalifa Haftar.

In a deepening proxy war, Turkey aims to send its navy to protect Tripoli, while its troops train and coordinate the forces of Prime Minister Fayez al-Sarraj, according to a senior Turkish official. Turkey recently signed a maritime deal with oil-rich Libya that serves the energy interests of both countries and aims to salvage billions of dollars of business contracts thrown into limbo by the conflict.

At the same time, ethnic Turkmen rebel groups that have fought alongside Turkey in northern Syria are expected to reinforce the government in Tripoli imminently, said the Turkish official and a senior official with the Tripoli-based Government of National Accord. Both people asked not to be named because of the sensitivity of the issue. The Libyan government initially resisted the idea of such a deployment but eventually accepted it as Haftar’s forces began to advance on Tripoli, the Libyan official said.

Hassan al-Houni, a Libyan official who acts as a senior adviser to the prime minister, on Saturday denied that Syrian rebels will be deployed to Libya.

Rami Abdul Rahman, head of the U.K.-based Syrian Observatory for Human Rights, said as many as 500 Turkmen Syrian fighters have already been recruited in Turkey ahead of deployment to Libya. “They are recruiting the fighters from different factions” of Syria’s opposition groups, Abdul Rahman said.

With Egypt and the United Arab Emirates aiding Haftar, Turkey’s deeper involvement in Tripoli could complicate international efforts to end the turmoil that has gripped the country since the overthrow of strongman Moammar Qaddafi in 2011.

Read More:

How the Battle for Libya Has Become a Proxy Conflict: QuickTake

How Turkey Is Spoiling Big Plan for Mediterranean Gas: QuickTake

Turkish President Recep Tayyip Erdogan, who has vowed to prevent the fall of Sarraj’s government, could order the deployment of Turkish military in Libya in early January, after securing the approval of parliament.

The terms of the Turkish deployment will include:

Establishment of an elite Libyan force to respond immediately to threats

Allocation of weapons, planes, vehicles on ground and at sea

Joint exercises

Exchange of counter-terrorism intelligence and operational cooperation