Turkey’s parliament has passed a bill that will allow the government to deploy troops to Libya to intervene in the civil war.

Turkish lawmakers passed the bill on Thursday, with 325 in favour to 184 against.

Turkey is allied with Libya’s UN-backed government, which is based in the capital, Tripoli.

The Libyan government has been fighting an insurgency by forces under Gen Khalifa Haftar, based in eastern Libya.

Egypt, which backs Gen Haftar, condemned Turkey’s vote, saying it would “negatively affect the stability of the Mediterranean region”.

Last week, Turkish President Recep Tayyip Erdogan said he would seek parliamentary approval to provide military assistance following a request by the Tripoli government.

The bill allows for the deployment of non-combat troops, to act as advisers and trainers for government forces against Gen Haftar.

But experts fear the legislation could deepen Turkey’s involvement in the conflict and increase tensions with Gen Haftar’s backers, Egypt, Jordan and the United Arab Emirates (UAE).

Turkish Vice-President Fuat Oktay said the bill would be valid for one year, but gave no details about the scale of the potential military deployment.

“We are ready. Our armed forces and our defence ministry are ready,” Mr Oktay said.

Turkish members of parliament vote to send Turkish troops to Libya, in Ankara

The forces of Gen Haftar have been trying to capture the capital city from the Government of National Accord (GNA), led by Prime Minister Fayez al-Serraj.

Turkey argues the Libyan conflict could threaten its interests in the country.

What is the background to Libya’s civil conflict?

Libya has been torn by violence and division since long-time ruler Muammar Gaddafi was deposed and killed in 2011.

Since then, the country has been racked by civil war, with no authority in full control.

The latest episode of conflict started in April last year, when Gen Haftar launched an attack on Tripoli in an attempt to oust the internationally recognised government.

Gen Haftar

But eight months on, the battle continues with the GNA keeping Gen Haftar’s forces at bay on Tripoli’s southern outskirts.

In recent weeks, the fighting escalated after Gen Haftar declared a “final” and decisive battle for the capital.

What reaction has there been to the bill’s passage?

Mr Oktay said the passage of the bill sent a “political signal” to Gen Haftar’s forces.

“The Libyan motion is important for the protection of the interests of our country and for the peace and stability of the region,” Turkey’s Foreign Minister Mevlut Cavusoglu tweeted after the vote.

In contrast, Egypt said the bill amounted to “a flagrant violation of international legitimacy” on the part of Turkey.

“Egypt warns against the consequences of any Turkish military intervention in Libya and stresses that such intervention will negatively affect the stability of the Mediterranean region,” Egypt’s foreign ministry said in a statement.

Egyptian President Abdul Fattah al-Sisi chaired a meeting of the National Security Council to discuss “foreign military intervention” in Libya.Presentational white space

Before the bill’s passage, Mr Erdogan discussed the Libyan conflict with US President Donald Trump in a phone call, the Turkish presidency said.

Mr Trump and Mr Erdogan “stressed the importance of diplomacy in resolving regional issues”, it said.

Ankara risks becoming even more deeply embroiled in Libya’s civil conflict and its decision to deploy troops marks a new stage in the internationalisation of the conflict.

Turkey has already supplied armoured vehicles to the UN-recognised Government of National Accord in Tripoli and also operates drones on its behalf.

Turkish troops will apparently be deployed in a “training and advisory” role. But this is a highly flexible description. If the Tripoli government has its back to the wall, then Turkey may be compelled to take a more direct hand in the fighting.

Gen Khalifa Haftar’s Libyan National Army is backed by Egypt, Jordan and crucially the UAE. It has received direct support on the ground from semi-official Russian military contractors and from Sudanese and Chadian mercenaries.

Turkey clearly sees Libya as part of its strategic hinterland in the eastern Mediterranean. It recently signed an economic agreement with Tripoli on energy exploration. But Turkey’s actions could leave it more isolated and stoke a broader regional crisis.