The United Nations secretary-general has welcomed an agreement between rival Libyan leaders to hold elections.

The agreement came in a meeting Wednesday in the United Arab Emirates' capital between Prime Minister Fayez al-Sarraj, head of Libya's U.N.-recognized government in Tripoli in the west, and Gen. Khalifa Hifter, the commander of Libya's national army which dominates the east.

In a statement late Friday, Antonio Guterres commended both parties' "agreement on the need to end the transitional stages in Libya through the holding of general elections."

Hifter and Sarraj had agreed to a Paris-brokered deal in May 2018 and hold a nationwide election by the end of the year. But their disputes delayed those plans.

Libya slid into chaos after a 2011 uprising that toppled long-time ruler Moammar Gadhafi.