The United Nations mission in Libya says the country's rival groups have agreed to hold talks on September 29 for the first time since the latest surge of violence that left the country torn between two parliaments and governments.

In a Sunday statement, the United Nations Support Mission in Libya said a joint UN-Libyan committee has agreed to oversee a future ceasefire and that rival groups must agree on a timeline to withdraw armed groups from major cities, airports and other public installations.

Libya's elected House of Representatives was forced to convene in the eastern city of Tobruk after Islamist-allied militias seized the capital, Tripoli, and the second-largest city, Benghazi.

The militias formed their own government and revived an outgoing parliament to serve as parallel bodies in Tripoli.