Libya's rival authorities have edged closer to forming a unity government as part of a peace deal for the war-torn country, its UN envoy said on Sunday.
"After long hours of discussions, we have reached... a consensus on the main elements," Bernardino Leon told reporters in Skhirat near the Moroccan capital, where talks resumed last week.
EU foreign policy chief Federica Mogherini called the progress "encouraging" and Italy said the coming week would be "decisive".
Libya, torn apart since dictator Moamer Kadhafi's ouster in 2011, has two rival administrations -- the General National Congress (GNC) in Tripoli and an internationally recognised government in the east.
The factions agreed in January to set up a national unity government to restore stability to the North African country, but have disagreed about the details.
The GNC rejected a proposal in July, and only joined the most recent negotiations at the last minute.
Points raised by the GNC have been introduced into the latest draft, Leon said, calling on the internationally recognised government to accept the amendments.
"Even if... they feel frustrated because this text will have some changes, (I call on them to) accept these changes for the sake of their country," he said.
"We are going to distribute the text to the parties and we are going to work on this text tonight (Sunday), and we believe that this text will... be voted by the two parties," he said.
Signup to our newsletter and follow us on Facebook and Twitter!
GNC representatives will submit the updated agreement to their parliament, said Leon.
"They are going to come back... with their names to propose candidates for the national unity government," he said.
The internationally recognised parliament earlier this month adopted a list of candidates for a unity government.
Leon's plan calls for a unity government deal by September 20, ahead of the UN General Assembly, with the government coming into force a month later.
"While this is encouraging, it is now urgent to bring the talks to a swift conclusion and close the deal," Mogherini said on Sunday of the latest development.
"I expect all participants will engage constructively in the interests of all Libyans to finalise an agreement in the coming days," she said, adding that Leon had the "wholehearted support" of the European Union.
Italian Foreign Minister Paolo Gentiloni also welcomed the progress.
"We are in the final stretch and the coming week will be decisive for reaching an accord between the parties to the political dialogue in Libya," he said.
Italy has said it will be prepared to lead an international peacekeeping force in its former colony in the event of a peace deal and ceasefire between the warring parties.
The rise of the Islamic State jihadist group and Libya's emergence as a smuggling hub for migrants risking their lives to cross the Mediterranean have added to the urgency of the long-running talks.