GAMMARTH, Tunisia — Libya's warring sides have agreed to hold nationwide elections in December next year, the top U.N. official for the North African country said Friday in a sign of progress from the U.N.-brokered peace talks underway in Tunisia.

The gathering, which started on Monday, was aimed at setting a roadmap out of Libya's yearslong civil war. It is also the latest effort to end the chaos that engulfed the North African country after the 2011 overthrow and killing of dictator Moammar Gadhafi. Previous diplomatic initiatives have repeatedly collapsed.

In a virtual press conference from Tunisia, U.N. acting envoy for Libya Stephanie Williams said the elections will take place on Dec. 24, 2021 and allow Libyans to "renew, really, the legitimacy of their institutions."

Earlier this week, she announced that the participants had agreed to hold elections no later than 18 months from now.

The U.N. had selected 75 delegates from Libya to take part in the week-long forum at a luxury hotel in the Mediterranean town of Gammarth, just outside the capital of Tunis. The talks came amid heavy international pressure after the warring sides agreed to a U.N.-brokered cease-fire agreement last month in Geneva.

Oil-rich Libya is now split between a U.N.-supported government in the capital, Tripoli, and rival authorities based in the east. Those sides are backed by an array of local militias, as well as regional and foreign powers.

Eastern Libya forces, led by commander Khalifa Hifter, launched an offensive in April 2019 to try and capture Tripoli. His campaign collapsed in June, when the Tripoli-allied militias, with heavy Turkish support, gained the upper hand.

Williams said the election date also holds symbolic value, as it will be the 70th anniversary since Libya declared independence.