The International Court of Justice (ICJ) has settled a decades-old border dispute between the West African nations of Niger and Burkina Faso.
The two countries turned to the ICJ to settle disagreements dating back as far as 1927, under French colonial rule.
The Hague court demarcated territory covering an area of 380km, over half the length of the border.
Representatives from both governments expressed satisfaction with the ICJ ruling.
For decades, the two countries had tried to solve the issue themselves by setting up a joint technical commission.
In 2006, leaders met in the border regions to try to dissipate tensions caused by incursions of security forces and customs officials on either side of the frontier.
They eventually filed a joint suit with the ICJ in July 2010, promising to abide by the court's final decision.
ICJ President Peter Tomka said the judges were guided by a 1927 ruling issued by the governor-general of French West Africa and a map published by a French government agency in 1960.
The court asked both countries to consider the needs of the nomadic population, who reside in the north of the disputed territory, when laying down the border.
"I think that the court sliced up the territory fairly," Niger's Justice Minister Marou Amadou told AFP.
"We gain a little in the north, we lose a bit in the south. Both countries win out because there's no more border dispute."
Speaking after the lengthy ruling was read out, Burkina Faso's Minister of Territorial Administration and Security Jerome Bougouma said: "We are parting as good friends, very good friends."
"There was often confusion concerning the security forces, patrols and the collection of taxes. All that's over now."
Correspondents say the case is being seen as an example of how African neighbours can resolve territorial disputes peacefully.
Several mining companies say they have projects at various stages in areas near the Niger-Burkina Faso frontier.
Gold reserves were also recently discovered in the region. The ICJ ruling gave no indication of where the new boundary will lie in relation to these deposits.