The deal was signed in the presence of Idriss Deby, the president of Chad, Omar al-Bashir, the president of Sudan, and Muammar Gaddafi, the leader of Libya.
Deby said: "I hope this is the last stage in the peace process in Chad and I guarantee that all signatories will abide by the agreement."
The groups to sign were the Movement for Resistance and Change, the National Accord of Chad and two factions of the Front for United Forces for Development and Democracy.
An official who spoke to Reuters news agency, and who asked not to be named, said. "The government of the Republic of Chad and the four main rebel movements based in Sudan have signed tonight in Libya a definitive peace accord."
The accord foresees an immediate ceasefire and the setting up of a committee which will decide on the integration of members of the rebel groups into Chadian state structures.
Since independence from France in 1960, Chad has had civil wars and has been invaded twice.