Shkirat, Morocco: Lawmakers from Libya’s internationally recognised parliament agreed Friday to return to peace talks after resolving an internal dispute, reviving hopes that a deal is within reach, a UN envoy said.

Spanish diplomat Bernardino Leon’s plan calls for an accord on the formation of a national unity government to be reached by Sunday, in time for the UN General Assembly in New York which continues through October 6.

But successive proposals have met with resistance from one side or the other and the internationally recognised parliament based in Tobruk in Libya’s far east on Tuesday said it was withdrawing from the latest session of talks.

A relieved Leon announced on Friday in Morocco that the Tobruk parliamentarians had bridged their differences and agreed to re-engage in the process, describing it as “very good news”.

But he said work still remained to reach a final agreement between the Tobruk parliament and the rival General National Congress (GNC) based in the militia-held capital.

Libya has been torn apart since the 2011 overthrow of veteran leader Moamer Kadhafi, with two rival administrations and militias battling for control of the oil-rich North African nation.

The advance 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 peace talks.

The Tobruk legislature signed a draft deal in July but changes were made at the request of the Tripoli-based GNC.

Amendments suggested by the GNC - including a call to respect a judgment by the Tripoli-based supreme court invalidating the internationally recognised government - were then rejected by the Tobruk-based administration.

Leon said the GNC delegation was expected to return to the talks in the Moroccan seaside resort of Skhirat later Friday.

“We still have to reach a final agreement on the other issues,” he said. “We have little time, a lot of work to do and we will continue to inform on the evolution.”