Burkina Faso and Niger have agreed to 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 next year, when the boundary drawing is complete, the permanent secretary of the Burkina Faso national border commission, Joséphine Kouara Apiou/Kaboré, announced this week.

Niger and Burkina Faso, which were French colonies prior to independence in 1960, share a frontier of roughly 620 miles (998km), 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 by the international court of justice in the Hague.

That ruling ordered the exchange of swaths of territory between the two countries, with 786 sq km (303 sq miles) handed to Burkina Faso and 277 sq km (107 sq miles) 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 affected areas and locals will be allowed to choose which nationality they would like to hold, Kourara 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 shares more than 3,000 km (1,900 miles) 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.