Turkey’s Parliament on Thursday voted to send troops to Libya in support of the government in Tripoli.
The vote during an extraordinary session of Parliament saw 325 members support the government motion, with 184 against.
The ruling Justice and Development Party (AKP) and its Nationalist Action Party (MHP) ally control 339 of 589 seats, making the outcome widely anticipated.
The opposition Republican People’s Party (CHP), Democratic Peoples’ Party (HDP) and Iyi Party, who have 239 seats between them, spoke out against the bill before the vote.
MHP member Erkan Akcay said backing the Tripoli regime was a “legal obligation”, while the AKP’s Ismet Yilmaz said it was in Turkey’s national interest.
Meanwhile, CHP leader Kemal Kilicdaroglu tweeted that UN peacekeepers should be sent to the war-torn country.
“Turkey should lead the way in giving stabilisation to the region," Mr all diplomatic efforts should focus in this direction,” Mr Kilicdaroglu said.
HDP member Tulay Hatimogullar Oruc told Parliament that the bill “continues to add black pages to the history of this country”.
The Iyi Party’s Aytun Ciray said the motion “will send our sons to Timbuktu to become martyrs”.
The vote gives President Recep Tayyip Erdogan a year to decide on the timing and extent of Turkish military support for Prime Minister Fayez Al Sarraj’s Government of National Accord.
Tripoli has been under siege from the eastern-based forces of Field Marshal Khalifa Haftar since April, with fighting intensifying in recent weeks after Russian and Sudanese forces joined the attack.
Turkey, Qatar and Italy support the government of Mr Al Sarraj in Tripoli, who Mr Erdogan said had requested Turkish military aid.
The vote, held five days before Parliament was due to return from recess, gave Mr Erdogan wide scope in deciding the strength of forces sent, from a limited number of trainers and advisers to significant ground, air and naval forces.
At its greatest extent, the Turkish contingent could take on the task of halting the assault on Tripoli, protecting the city from the sea and providing a no-fly zone over GNA-controlled territory.
Vice President Fuat Oktay suggested on Wednesday that Turkey might delay sending the troops if the Tripoli offensive ended.
Mr Oktay said he hoped the resolution would act as a deterrent to the warring sides.
A day earlier, Foreign Minister Mevlut Cavusoglu raised the possibility of a “worst case scenario” that would mean Turkish troops directly confronting the besieging forces.
Sending Turkish troops is aimed at “eliminating attacks on the interests of Turkey and Libya by illegal armed groups and terrorist organisations”, the resolution said.
Turkey has significant commercial interests in Libya, many of which have been threatened by the conflict.
It recently signed two agreements with Mr Al Sarraj on military co-operation and maritime boundaries in the eastern Mediterranean.
The military bill came amid reports that Ankara had already sent Syrian militia fighters to Libya.
Conflict monitor the Syrian Observatory for Human Rights reported that 300 Turkey-backed Syrian fighters had been sent to Libya, while others were undergoing training.
The UN said Turkey had sent military hardware to the Tripoli government despite an international arms embargo.
Libya has been in turmoil and without any overall authority since long-time leader Muammar Qaddafi was deposed and killed in 2011.
Turkey’s involvement in Libya comes after a third military incursion into Syria in October and continuing missions in northern Iraq, with troops also posted in countries such as Qatar and Somalia.
On Thursday, US President Donald Trump warned Mr Erdogan against any action in Libya.
In a call, Mr Trump "pointed out that foreign interference is complicating the situation in Libya", White House spokesman Hogan Gidley said.