The presidents of Chad and Sudan have signed an accord in Senegal aimed at halting five years of hostilities between the two countries.
The non-aggression pact was brokered by Senegal's president (l)
Chad's Idriss Deby and Sudan's Omar al-Bashir agreed to implement past failed peace pacts at a Dakar summit.
The neighbours have often accused each other of supporting rebel movements trying to overthrow their governments.
The BBC's Will Ross in Dakar says none of the rebels are included in the deal, so it may not be enforceable.
Our correspondent says it is the sixth deal in five years and the war of words between the two sides is highly unlikely to end with signing of the agreement.
Hours before they met, Chad accused Sudan of sending heavily armed columns of Chadian rebels across its border. There has been no independent confirmation of any crossing.
Thursday's signing ceremony was witnessed by UN Secretary General Ban Ki-moon.
The accord was struck on the fringes of an Organisation of the Islamic Conference summit under Senegalese President Abdoulaye Wade's mediation.
The deal - known as the Dakar agreement - commits the two nations to implementing past accords that have failed.
It calls for the establishment of a monitoring group of foreign ministers from a handful of African countries that would meet monthly to ensure there have been no violations.
The deal said the leaders had agreed to "inhibit all activities of armed groups and prevent the use of our respective territories for the destabilisation of one or the other of our states", reported the Associated Press news agency.
Our correspondent says the two leaders have been under intense international pressure to sign and neither wanted to be seen as the spoiler.
But he says what everyone will be watching is the situation on both sides of the border to see if the pact makes any difference.
As for international enforcement of the deal, our reporter says the presence of the recently deployed European peacekeeping force on the Chadian side of the border has a greater chance of stopping a rebel coup in Chad.
This is partly because there is only one main road from the border to the capital, N'Djamena.
However, his says the common border is vast and in Sudan international peacekeepers on the ground are few and far between.
The whole peacekeeping effort would need to be ramped up in Darfur to deal with any kind of enforcement, he says.
Optimists feel the deal must be given a chance given the disastrous humanitarian situation on both sides of the border and every opportunity to end fighting should be explored, our reporter says.
French troops evacuated expatriates during Chad's recent coup attempt
However, rebels from both Chad and Sudan have dismissed the agreement as a piece of paper.
Sudan earlier dismissed Chad's claims that it had sent Chadian rebels over the border on Wednesday as "complete nonsense".
Chadian rebels say they already operate inside the country and EU peacekeepers there said they had detected no incursion.
Earlier, an announcement on Chadian radio said "several columns of heavily armed rebels" had crossed the border from Sudan near the town of Ade.
But the Chadian rebel National Alliance denied any cross-border movements from its fighters.
A rebel attempt to overthrow President Deby's government was thwarted last month.
In recent weeks Chad has taken steps to prevent attacks from rebels, including digging a deep trench around N'Djamena and cutting down trees which could provide cover for attackers.
The government fought off last month's attempted coup in a fierce two-day battle.
The attack took place just before the deployment of the European force to safeguard refugees from Darfur in eastern Chad and the Central African Republic.