The agreement was signed late on Sunday in the Libyan capital by the leader of the Sudan Liberation Army (SLA), Abdelwahid Mohamed el Nur and Khalil Ibrahim, leader of the Justice and Equality Movement (JEM).
It called for "an immediate halt of all enmities and negative media campaigns and to resort to dialogue to solve any dispute between them".
The two groups agreed to release detainees, work to normalise relations and rebuild confidence and coordinate work on other issues.
Libya has been mediating disputes between Darfur rebel groups and the government of Sudan to try to bring an end to the deadly two-year conflict that has left tens of thousands dead in Sudan's western region.
The rebels and the government last met two weeks ago in the Nigerian capital of Abuja and agreed to broad, generalised commitments, including respecting the nation's unity, upholding democracy and justice and equality for all, regardless of ethnicity, religion and gender.
Darfur rebels have also been in
talks with the government
They were still working out agreements on sharing power and wealth, something they would follow up in the next meeting scheduled for 24 August.
Darfur's crisis began in February 2003 when African rebels rose up against the Arab-dominated government, claiming discrimination in the distribution of scarce resources in the large, arid region.
Bloodshed ensued when pro-government militias attacked Darfur villages. The United Nations has called Darfur the world's worst humanitarian crisis and said it has claimed 70,000 lives and 1.5 million are now homeless after having fled their homes since February 2003.