U.N. Secretary General Ban Ki-moon has arrived in Libya's capital of Tripoli to urge rival groups to resolve the bloody rift that has left their oil-rich North African nation deeply split with two separate parliaments and governments.

Ban's visit Saturday is his first to Libya and comes after the U.N. launched a dialogue late last month to mediate between the warring Libyan groups.

Libya witnessed a spasm of violence this summer when militias mainly from the western city of Misrata and groups allied to Islamists swept through the capital, backing the country's previous parliament.

Meanwhile, Libya's newly elected parliament and government backed by non-Islamists, driven out of the capital, have been meeting in the country's east.

Ban plans to meet with lawmakers from the rival parliaments during his visit.