Turkish troops have begun deploying to Libya in a bid to prop up the UN-recognised government in Tripoli, the Turkish president, Recep Tayyip Erdoğan, has announced.

The move followed a vote in the Turkish parliament backing deployment and further deadly attacks in Tripoli by an airforce under the control of Marshal Khalifa Haftar, the warlord who has been trying to oust the government since April.

Erdogan told CNN Turk on Sunday that Turkish forces were already on their way to Libya. “Our soldiers’ duty there is coordination. They will develop the operation centre there. Our soldiers are gradually going right now,” he said.

The Turkish deployment, likely to take many weeks, risks a military confrontation between Turkey and other regional actors supporting Haftar, notably the United Arab Emirates and Egypt.

Russian mercenaries, believed to have the backing of the Russian president, Vladimir Putin, are also operating in Libya in support of Haftar. Putin has urged Erdoğan not to send troops.

Erdoğan has been signalling his support for the UN-backed Government of National Accord (GNA) ever since he signed a memorandum of understanding with Libya’s prime minister, Fayez al-Serraj, in which the two sides agreed to carve out drilling rights in the Mediterranean and to cooperate militarily.

European powers for years have failed to mediate an end to the conflict in Libya between the east and the west of the country, leaving a vacuum that Turkey is eager to fill. The latest European effort is to be a conference in Berlin, but its date has been repeatedly postponed as regional powers dispute the conference’s purpose and attendance list. Attention to the rise in violence in Libya has been reduced due to the focus on north-east Syria and the US conflict with Iran.

The speed of Turkish actions has been prompted by signs that Haftar’s Libyan National Army (LNA) is stepping up its attacks on Tripoli, including a deadly air raid on the Hadaba military academy at the weekend that left 30 dead and 33 injured.

The GNA called for an emergency meeting of the UN Security Council to denounce the strikes, describing them as a war crime.

But Turkey already has forces engaged in northern Syria, and the Turkish political opposition has opposed the deployment to Libya, fearing that the Erdoğan government is overstretching itself militarily.

The US embassy in Libya at the weekend called for an end to “the toxic foreign interference in Libya”, citing “the arrival of Syrian fighters supported by Turkey as well as the deployment of Russian mercenaries”. The embassy added: “All Libyan parties have a responsibility to end this dangerous involvement of foreign forces, which is contributing to civilian casualties and damaging civilian infrastructure to the detriment of all Libyans.”

The statement made no mention of the role of the United Arab Emirates, which has been supplying air support to the LNA for months, if not years.

The UAE believes that Islamist militia, regarded as terrorists by the UAE, form the backbone of the GNA’s military support. The Tripoli government, furious at the lack of European support, insists that it is a democratic force fighting Haftar, who is a proven war criminal and authoritarian.