The government of Libyan Prime Minister Fayez Al Sarraj and the armed forces of warlord Khalifa Haftar have signed an armistice in Geneva, Switzerland.
The two sides have agreed, among other things, that all foreign fighters must leave the country within three months, UN envoy Stephanie Williams announced.
The members of the warring factions made it known that the truce should end the violence in Libya. However, previous attempts to find a diplomatic solution to the conflict have been unsuccessful. Political consultations between the two parties will begin later this year.
Since the death of dictator Muammar Gaddafi in 2011, Libya has been in chaos and war. Previous attempts by Russia and Turkey to negotiate a ceasefire have failed.