Libya's warring sides signed an agreement for "a permanent ceasefire in all areas of Libya", the United Nations Libya mission said on Friday, showing <a href="https://www.facebook.com/UNSMIL/videos/2362054877274602">live video</a> of the ceremony to sign the agreement. Speaking with reporters in New York, UN Secretary-General Antonio Guterres called the deal a “fundamental step toward peace and stability in Libya” and urged all foreign players involved to abide by its terms “without delay”. The deal follows mediation this week led by UN envoy for Libya Stephanie Williams at the 5+5 Joint Military Commission representing Libya's rival administrations in Tripoli and the country's east, each backed by local armed forces as well as foreign powers. Ms Williams told a press conference in Geneva, where the talks were taking place that a complete, countrywide and permanent ceasefire had been agreed with immediate effect. "This shall be accompanied by the departure of all mercenaries and foreign fighters from all Libyan territory, land, air and sea within a maximum period of three months from today," she said. "The ceasefire does not apply to UN-designated terrorist groups." All parties to the talks confirmed their commitment to the confidence building measures of opening land and air routes, curbing the use of hate speech and incitement to violence between the parties, exchange of detainees and the restructuring of the Petroleum Facilities Guards, a militia allied to Libya's eastern forces. Ms Williams told the press conference that the oil exports from the Ras Lanuf and Es Sidr terminals would be ready to resume "in a very short period of time". She also welcomed a flight on Friday between Tripoli and the eastern city of Benghazi. Details of the ceasefire, which the UN called an “important turning point towards peace and stability in Libya”, were not immediately available. "We have had enough suffering, enough bloodshed," said Ali Abushahma, the head of the Tripoli delegation. "We hope we will change the suffering on all the territories of Libya, especially in the south. “I appeal to all Libya: Be one hand,” he said. Control of Libya is split between the UN-recognised Government of National Accord in Tripoli and the House of Representatives administration based in the east. The two sides are backed by an array of local militias as well as regional and foreign powers. The country was plunged into chaos after the 2011 uprising that toppled and killed longtime dictator Muammar Qaddafi. “I call on the international community to support Libyans in implementing the ceasefire and in bringing an end to the conflict,” said Mr Guterres. “This includes ensuring the full and unconditional respect for the Security Council arms embargo.” “The road to a permanent ceasefire deal was often long and difficult,” Ms Williams said, noting that there was a “great deal of work” to do in the coming weeks to implement the commitments. She hoped the agreement would succeed “in ending the suffering of Libyans and allowing those displaced by the conflict to return to their homes”. The latest meeting of the Joint Military Commission, set up under a framework agreed at an international peace conference hosted by Germany in January, comes ahead of a political forum in Tunisia in November. That meeting will aim to “generate consensus on a unified governance framework and arrangements that will lead to the holding of national elections”, the UN mission said. Ghassan Salame, the UN special envoy to Libya from 2017 until his resignation in March, was among the first to hail the breakthrough, saying on Twitter: "I truly hope the same patriotic spirit will inspire the political dialogue to be convened soon." Ms Williams announced on Wednesday that the two sides had reached agreement on issues that “directly impact the lives and welfare of the Libyan people", including the opening of air and land routes in the country, reducing inflammatory rhetoric in Libyan media, and restarting Libya’s vital oil industry. Libya’s prized light crude has long featured in the country’s civil war, with rival militias and foreign powers jostling for control of Africa’s largest oil reserves. Oil production resumed last month after a months-long blockade by powerful tribes allied with Field Marshal Khalifa Hafter, the leader of the eastern-based forces.