The Libyan parliament aligned with strongman Khalifa Haftar has passed a motion supporting an Egyptian military intervention if needed against what it termed a Turkish "occupation".
The assembly based in Libya's east agreed late Monday it would back an intervention by its ally Egypt if it was deemed necessary to safeguard the "national security" of both countries.
Libya has been torn by violence since the 2011 ouster of long-time leader Moamer Kadhafi in a NATO-backed uprising, and the conflict has since drawn in multiple foreign powers.
The Turkish-backed and UN-recognised Government of National Accord (GNA) based in Tripoli in the west has been battling Haftar's forces, which are supported by Egypt, the United Arab Emirates and Russia.
The GNA, with stepped-up Turkish support, in June repelled Haftar's 14-month siege of the capital and launched a counteroffensive that is now stalled outside the coastal city of Sirte.
Egypt's President Abdel Fattah al-Sisi, alarmed by Haftar's setback, warned last month that Cairo could send troops into Libya.
The Egyptian military said Saturday it had carried out exercises involving navy, airforce and special forces near its border with Libya in response to the "severe and rapid changes" in the region.
The pro-Haftar legislature based in Tobruk said in its resolution it had authorised "Egyptian armed forces to intervene to protect the national security of Libya and Egypt if they see an imminent danger to both our countries".
Libya and Egypt should work together, it said, "to guarantee the occupier's defeat and preserve our shared national security" in the face of "the dangers posed by the Turkish occupation".
'Drums of war'
The UAE on Tuesday also issued an implicit warning to GNA forces advancing eastward on Sirte, the home city of the slain dictator Kadhafi.
"The drums of the war raging around Sirte in Libya threaten serious developments and dangerous humanitarian and political consequences," tweeted minister of state for foreign affairs Anwar Gargash.
"We in the UAE call for an immediate ceasefire and for wisdom to prevail," he added, calling for inter-Libyan dialogue "within clear international frameworks".
Years of international efforts have so far failed to bring a lasting peace to the oil-rich country.
Sisi had in June called Sirte a "red line" for Egypt, while Ankara urged Haftar to withdraw from the strategic city and negotiate a ceasefire.
Relations between Cairo and Ankara have been deteriorating since 2013, when Sisi led the army's ouster of Islamist president Mohamed Morsi, a Muslim Brotherhood figure close to Turkey.
Haftar had launched his offensive in April 2019 to seize the capital, but the GNA took advantage of Turkish military support including drones to re-impose its control over Libya's northwest.
While Libya's parliament, elected in 2014, rejects the unity government's legitimacy, it is also interally divided into pro- and anti-Haftar factions.