Burkina Faso and Niger have announced they will exchange 18 towns in order to settle a long-running border dispute and end years of litigation.

Burkina Faso is to gain 14 towns and Niger will receive four between now and the end of 2016 when the boundary drawing is complete, Kouara Apiou Kabore, the permanent secretary of the Burkina Faso National Border Commission said this week.

Niger and Burkina Faso, which were French colonies prior to independence in 1960, share a frontier of about 1,000 kilometres (621 miles), about a third of which has been mapped out on the ground.

The rest of the border, which has been contested by both countries, was redefined in a 2013 decision from the International Court of Justice in The Hague.

That ruling ordered the exchange of vast swathes of territory between the two countries, with 786 square kilometres handed to Burkina Faso and 277 square kilometres to Niger. The countries have just now agreed to implement that decision.

Once the chunks of territory have been exchanged, authorities will perform a census in the impacted areas and locals will be allowed to chose which nationality they would like to hold, Apiou said.

“They will have five years to make their choice,” she added.

Niger’s justice minister and government spokesman Marou Amadou said the borders dated from 1926.

“The borders were drawn by non-Africans. Now we have settled this,” Amadou told AFP.

This case of rewritten borders may not be the last for Burkina Faso, which has more than 3,000 kilometres of frontier with Benin, Ivory Coast, Ghana, Mali, Niger and Togo, with about a third of those boundaries still needing to be demarcated, authorities said.