A ceasefire is needed in Libya to avoid escalation in the civil war, Egyptian President Abdel Fattah El Sisi and US leader Donald Trump said in a call on Monday night.
Mr El Sisi and Mr Trump spoke as Egypt's Parliament went into a closed session and gave approval for intervention if the country were threatened by "terrorist groups" and "militias".
"The two leaders affirmed the need for immediate de-escalation in Libya, including through a ceasefire and progress on economic and political negotiations," the White House said.
It said Mr Trump told French President Emmanuel Macron by phone that the conflict "has been exacerbated by the presence of foreign forces and arms".
UN spokesman Stephane Dujarric said: "There is no military solution to the current crisis in Libya and there must be an immediate ceasefire."
Egypt is concerned about instability in Libya and Turkey's support for Tripoli forces.
The Tripoli government-aligned forces have moved closer to the coastal city of Sirte, which they hope to recapture from Field Marshal Khalifa Haftar's Libyan National Army.
Mr El Sisi has declared the Sirte, the gateway to oil-export ports, a red line for Egypt.
The head of the defence committee in the eastern Libyan House of Representatives, Talal Al Mayhoub, said the parliamentary approval was the first step towards activating an Egyptian-Libyan defence pact.
The House of Representatives has already voted to allow an Egyptian intervention if requested.
Mr El Sisi said last week that Egypt would not stand idle in the face of threats to Egyptian and Libyan security, and that any intervention in Libya would require the approval of Parliament.
Turkish military support for the Tripoli administration has contributed to the LNA falling back in its 14-month offensive on Tripoli, a setback for Field Marshal Haftar's plan to unify Libya.
A big escalation in Libya could risk igniting a direct conflict among the foreign powers, which have poured in weapons and fighters in breach of an arms embargo.
Mr El Sisi and Mr Trump also discussed Ethiopia's Blue Nile dam, the Egyptian presidency said.
Cairo is worried that Ethiopia will start filling the dam without an agreement with Cairo and Sudan, which would also be affected.