Egypt’s leader Abdel Fattah al-Sisi has threatened to intervene militarily in neighbouring Libya if Turkish-backed forces capture Sirte, a strategic port and gateway to important oil  terminals.

The warning adds to tensions in the war-torn, oil-exporting North African country that has become a proxy battleground for regional and international powers. Weapons and mercenaries have poured in to all sides, stymieing UN efforts to forge a negotiated settlement and ensure compliance with an arms embargo.

In televised remarks after inspecting military units at an army base near the border with Libya, Mr Sisi warned that the fall of Sirte or the inland Jufra airbase would be a “red line” for Egypt.

Any Egyptian action in Libya would “have international legitimacy” because it would be self-defence against “threats from terrorist militias and mercenaries”, he told soldiers. “If the Libyan people … asked us to intervene, this would be a signal to the world that Egypt and Libya are one country, one interest,” he added.

Cairo backs Khalifa Haftar, the eastern military strongman whose 14-month offensive to seize Libya’s capital Tripoli was thwarted largely because Ankara helped his opponents. Gen Haftar had to pull back from Tripoli’s outskirts after Turkish drones inflicted losses on the battlefield. The drones were used to back up militias aligned with the UN-recognised Government of National Accord.

Mr Sisi also said hostilities should cease on current battle lines and called for “talks and negotiations” to reach a solution to the crisis.