Turkey has voted to send troops to Libya as part of a security deal with the UN-brokered authority in Tripoli – inaugurating a new era of tensions in the eastern Mediterranean.

Recep Tayyip Erdogan, the Turkish president, said he would consider deploying the troops only at the request of the UN-backed government, led by Fayez Serraj. Insiders have already suggested that Mr Serraj will end up asking for up to 2,000 Turkish soldiers to defend the capital against the forces of renegade officer Khalifa Haftar and his foreign backers.

The controversial measure to send troops was passed in Turkey's parliament on Thursday by 325 to 184 votes, with opposition lawmakers voting against it.

Turkey has already reportedly recruited and deployed scores of Syrian fighters to Libya to bolster forces defending the capital, Tripoli. That has elicited protests from Mr Haftar’s backers, including the United Arab Emirates and Egypt, the latter of which organised an emergency summit of the Arab League this week to discuss Libya.

The security and maritime pacts between Libya and Turkey have also provoked Greece and Cyprus, which are nervous about Turkish expansion across the Mediterranean. Both have begun conferring with Cairo and lining up with Haftar’s backers, which include France and Russia. Greek foreign minister Nikolaos Dendias travelled to eastern Libya late last month to meet Mr Haftar.

Meanwhile Libya’s neighbour Algeria and its former colonial overlord Italy, loosely backing the government in Tripoli, appear more sanguine about the impending Turkish intervention.

Libya airstrike: Migrant detention centre hit in airstrike, killing 60 Show all 9 1 /9 Libya airstrike: Migrant detention centre hit in airstrike, killing 60 Libya airstrike: Migrant detention centre hit in airstrike, killing 60 Migrants carry the remains of their belongings from among rubble at a detention centre for African migrants that was hit by an airstrike in the Tajoura suburb of Libyan capital Tripoli on July 2 Reuters Libya airstrike: Migrant detention centre hit in airstrike, killing 60 Security and emergency responders work at the site of an airstrike that hit a detention centre for African migrants near Tripoli, Libya on June 2 Reuters Libya airstrike: Migrant detention centre hit in airstrike, killing 60 Security and emergency responders work at the site of an airstrike that hit a detention centre for African migrants near Tripoli, Libya on June 2 Reuters Libya airstrike: Migrant detention centre hit in airstrike, killing 60 The point of impact of a bomb that was dropped on a detention centre for African migrants near Tripoli, Libya on June 2 AFP/Getty Libya airstrike: Migrant detention centre hit in airstrike, killing 60 Blood stains are seen among debris following an airstrike that hit a detention centre for African migrants near Tripoli, Libya on June 2 Reuters Libya airstrike: Migrant detention centre hit in airstrike, killing 60 A woman picks up clothes among rubble at a detention centre for African migrants that was hit by an airstrike in the Tajoura suburb of Libyan capital Tripoli on July 2 Reuters Libya airstrike: Migrant detention centre hit in airstrike, killing 60 Migrants gather outside following an airstrike on the detention centre in the Tajoura suburb of Libyan capital Tripoli on July 2 AFP/Getty Libya airstrike: Migrant detention centre hit in airstrike, killing 60 A man carries his belongings from among rubble at a detention centre for African migrants that was hit by an airstrike in the Tajoura suburb of Libyan capital Tripoli on July 2 Reuters Libya airstrike: Migrant detention centre hit in airstrike, killing 60 Migrants sit together with their remaining belongings in the yard of the detention centre that was hit by an airstrike in the Libyan capital of Tripoli on July 2 Reuters

At stake is the future of Libya, now in the grips of a nine-month civil conflict pitting forces loyal to Mr Haftar against the authority in Tripoli, which is called the Government of National Accord.

But the entrance of Turkey as a player in Libya, with their maritime and security deals, has accelerated a scramble to exploit potentially hundreds of billions of dollars worth of underwater fossil fuel reserves claimed by the nations of the eastern Mediterranean. Greece and Cyprus worry the deals delineate maritime borders that Ankara could cite to explore oil and gas in the area.

The deals have “brought about gains of great strategic importance for our country”, Mr Erdogan said in a New Year’s Eve speech. “The projects aimed at entirely excluding Turkey from the Mediterranean have thus been wholly thwarted with our recent steps.”

Turkey has already sent military drones and armoured vehicles to its Libyan allies, while the UAE and Egypt continue funneling weapons to Mr Haftar, according to a United Nations report. Such actions are in violation of a UN arms embargo.

Experts say Turkey has long sought the maritime expansion deal, which gives it the ability to project its power across the sea and puts pressure on Greece to reopen long-dormant talks on control over disputed Aegean Sea islands and waterways.

“The gas and oil is the bonus,” said Yusuf Erim, an analyst at TRT World, Turkey’s public broadcaster. “Number one is the national security advantages of being able to open up into the eastern Mediterranean.”

Authorities in Tripoli initially refused to sign the deal, worried it would alienate potential allies in Europe, but gave in to Ankara’s request in November as Mr Haftar’s forces crept up on the capital.

“They self-immolated themselves from a diplomatic perspective to save themselves militarily,” said Jalel Harchaoui, a north Africa specialist at the Clingendael Institute, a Dutch think tank.

The deal gives Turkey a far greater stake in the events unfolding in Libya, which has strong historical ties to Anatolia. Fresh Turkish assistance to Libya could include anti-aircraft weaponry and jamming equipment to stop UAE-supplied combat and surveillance drones.

“The priority is to help avoid the collapse of the GNA government in Tripoli,” said Mr Harchaoui. “It is about making sure the GNA doesn’t get toppled by Haftar and the UAE.”

Viral video of Libyan man speaking out against war forces him to flee into exile

Open support for the Libyan government would also mark an escalatory challenge to the UAE, Russia and Egypt, which are providing arms and fighters to Haftar, raising the stakes in any bid to take over western Libya.

“Erdogan realised the clandestine space was overcrowded,” said Mr Harchaoui. “He thought he would get first-movers advantage by invading the official space.”

Mr Erim acknowledged that any dispatch of Turkish troops to north Africa would test the limits of the armed forces. Some Turkish voices have opposed the deal, which follows foreign military deployments to Syria and Qatar.