Egyptian President Abdel Fattah al-Sisi met Sunday with Libyan commander Khalifa Haftar, whose forces are fighting for control of the capital Tripoli, the presidency said.
"The president (Sisi) affirmed Egypt's support in efforts to fight terrorism and extremist militias to achieve security and stability for Libyan citizens throughout the country", it said in a statement.
Their discussion comes on the back of "the latest developments on the Libyan situation", it added.
Sisi has been an ardent supporter of Haftar's forces, which control swathes of eastern Libya and launched an offensive on April 4 to take the capital.
Fighting near Tripoli has killed 121 people and wounded 561, the World Health Organization said on Sunday.
Haftar has defied international calls to halt his battle against fighters loyal to the UN-backed Government of National Accord based in Tripoli.
The military strongman supports a parallel administration based in the Libya's east.
Earlier this month, Egyptian foreign minister Sameh Shoukry cautioned that the conflict could not be solved militarily.
His remarks came at a Cairo press conference with his Russian counterpart Sergei Lavrov, who also called for a political solution among all sides in Libya.
The Libyan commander has modelled his political style of authoritarian leadership after Sisi, himself an army general turned president.
Egypt has provided funding and arms to Haftar's self-styled Libyan National Army, seeing him as a bulwark against Islamist militants.
Haftar, who was exiled in the United States for two decades, returned to Libya in 2011 when the revolution erupted, commanding forces that eventually toppled dictator Moamer Kadhafi.
The oil-rich north African country has been in turmoil ever since with successive weak governments in place and several Islamist militias battling for territorial control.