"This is a historic moment the Libyans were waiting for, the Arabs were waiting for and the world was waiting for," said Awad Mohammed Abdul-Sadiq, the first deputy head of the Tripoli-based General National Congress (GNC).
GNC officials had been holding talks in the suburbs of Tunis for several days with delegates from the internationally recognised House of Representatives.
Abdul-Sadiq called on Libyans to support what he called "a historic opportunity".
Amna Emtair from the GNC delegation told AFP the agreement would set up a new representative body that would choose a committee to nominate a prime minister within 15 days, while another committee would conduct a review of Libya's constitution.
More From This Section
"It is a major breakthrough," Emtair said.
Libya descended into chaos after the October 2011 ouster and killing of longtime dictator Gaddafi, with two governments vying for power and armed groups battling for control of its vast energy resources.