Four Chadian rebel groups have sealed a peace agreement with the government, three weeks after negotiating the preliminary deal.
President Deby (left) attended the talks hosted by President Gaddafi
Libyan leader Colonel Muammar Gaddafi hosted the talks alongside the presidents of Chad and Sudan.
The insurgent groups have waged an on-off rebellion against Chadian President Idriss Deby for years.
The fighting was linked to the conflict plaguing the neighbouring Sudanese region of Darfur.
The UN says there are 240,000 refugees from Sudan's Darfur region in eastern Chad and 173,000 internally displaced people.
Col Gaddafi was quoted by AP news agency as saying: "I hope this is the last stage in the peace process in Chad, and I guarantee all signatories will abide by the agreement."
The army has been battling various rebellions for years
The deal was signed in the Libyan city of Sirte by the Movement for Resistance and Change, the National Accord of Chad and two factions of the Front for United Forces for Development and Democracy.
Under the deal, the parties agreed to an immediate ceasefire, an amnesty for civil and military personnel and the release of all prisoners.
The rebels were granted the right to form political parties and to join the military and security forces.
The accord comes weeks before the planned deployment in Chad's volatile east of a 4,000-strong European Union peacekeeping force.
The BBC's Stephanie Hancock in N'Djamena says the peacekeepers' mission is a daunting one.
Major General Pat Nash, the force's operational commander, says troops will be there to protect humanitarians and those displaced by fighting, not to get involved in internal politics.
"This is not a force that is coming in to subjugate anybody. This is a force that is coming in to be a deterrent essentially. We will not become involved in the internal affairs of either country. That is not my mandate," he told the BBC.
Our correspondent says there have been concerns about the force's very strict mandate.
But General Nash stood firm on the issue.
"My situation is primarily to deal with refugees and internal displaced people. I am not going into a preventive situation.
"I would only be in a reactive situation where people were being attacked," he said.
Chad has been plagued by civil wars and invasions since independence from France in 1960.