The United Nations peace envoy for Libya said on Wednesday he was confident that the past seven months of talks will yield an agreement on ending the violence in the north African country.

"I am increasingly confident that the process is finally drawing to its final stages," Bernardino Leon told the UN Security Council.

A final round of talks on forming a national unity government is expected to open this week, with the sides haggling over names for key posts in the new administration.

Libya has two rival parliaments and governments, with Tripoli controlled by Libya Dawn forces who seized the capital last year, forcing the internationally recognized government to operate out of Tobruk, in the northeast of the country.

The United Nations has been brokering talks between the groups with the aim of establishing a unified government that could confront the threat from Islamic State extremists, who have gained a foothold in several Libyan towns.

Libyan factions agreed during UN-brokered talks in January to set up a unity government to restore the stability that has been shattered since the 2011 fall of Muammar Gaddafi, but negotiations on modalities have run into hurdles.

"The talks have come a long way in narrowing the trust deficit that exists among Libyan political stakeholders and in forging an agreement on a roadmap," Leon told the 15-member council by video link from Paris.

The envoy voiced confidence that demands raised by the powerful Islamist-backed General National Congress parliament that sits in Tripoli can be addressed in the upcoming round.

The GNC sent representatives to the last round of negotiations in Geneva on August 11 and 12.