By Stephanie Nebehay
GENEVA (Reuters) - The United Nations' acting Libya envoy said on Wednesday she was "quite optimistic" that ongoing talks between the warring sides would lead to a lasting ceasefire, after they agreed to reopen land and air routes across front lines.
Speaking midway through week-long talks, Stephanie Williams said the sides had also agreed to maintain "the current state of calm on the front lines and avoid any military escalation".
"That is why I continue to be very optimistic that the parties here are going to reach a more lasting and permanent ceasefire," she told a news conference at the U.N. in Geneva.
The first flights between Tripoli and the main eastern city Benghazi would resume this week, and the sides had agreed to make progress on an exchange of detainees, Williams said.
Libya has been split since 2014 between an internationally recognised Government of National Accord (GNA) in Tripoli and Khalifa Haftar's Libyan National Army (LNA) in the east.
This year, the GNA, with backing from Turkey, halted a 14-month attempt by Haftar's forces to capture the capital with the backing of Russia, Egypt and the United Arab Emirates.
This week's meeting between GNA and LNA military negotiators in Geneva will be followed by a political dialogue in Tunis from Nov. 9, Williams said.
Foreign countries involved in the conflict "need to take their hands off of Libya", Williams said. Both sides have previously agreed that after a lasting ceasefire agreement is reached, all foreign forces and mercenaries must withdraw within three months, under U.N. supervision, she added.
Libyan oil output resumed in August after an eight-month blockade by the LNA, but the state producer, the National Oil Corporation (NOC), has warned of risks posed by a force that guards oil sites. Williams said the sides had agreed to delegate commanders from both east and west to work with the NOC on a proposal to restructure the guards to keep oil flowing.
An announcement by GNA Prime Minister Fayez al-Sarraj that he intends to step down by the end of this month "should help end the long period of transition" and move towards a democratically elected government, she said.
(Additional reporting by Angus McDowall in Tunis; Editing by Gareth Jones and Giles Elgood)