india bangladesh (2)
An Indian enclave resident and Bangladeshi citizen hold the border post that separates the enclave from the rest of Bangladesh July 10, 2015 in Lalmonirhat District, Bangladesh. Getty Images/Shazia Rahman

At one minute past midnight on Saturday, India and Bangladesh will take a major step toward ending one of the most complicated and protracted border disputes in the world. After over four decades of stalled negotiations, the governments of the two countries will begin swapping enclaves -- allowing Indian enclaves inside Bangladesh to merge with the latter, and vice versa.

The exchange of over 160 enclaves -- home to over 51,000 people -- will be carried out in a phased manner over the next 11 months, according to local media reports. The move comes nearly two months after the Asian neighbors ratified a landmark agreement, originally signed in 1974, to settle a dispute over their 2,540-mile land border.

“We have resolved a question that has lingered since Independence. … It will make our borders more secure and people’s life there more stable,” Indian Prime Minister Narendra Modi said, after the country's parliament ratified the Land Boundary Agreement (LBA).

The problem of the enclaves, which are essentially islands of foreign territory inside each country, can be traced back to a botched 1713 treaty between the Mughal Empire and the princely state of Koch Bihar, located in the present-day eastern Indian state of West Bengal. After India gained independence in 1947 and its subsequent partition resulted in the creation of Pakistan and Bangladesh -- then known as East Pakistan -- the governments of India and Pakistan failed to reach an agreement on swapping territories, given their tense relations.

Then, in 1974, three years after Bangladesh became independent, Indian Prime Minister Indira Gandhi and Bangladesh’s Prime Minister and founding leader Sheikh Mujibur Rahman signed the LBA, which called for exchange of enclaves and the surrender of “adverse possessions” -- land legally owned by one country, but under de facto control of the other.

As of now, over 14,000 people are believed to be living in Bangladeshi enclaves in India and more than 37,000 people residing in Indian enclaves in Bangladesh. Those living in Indian enclaves inside Bangladesh are officially Indian citizens and those in Bangladeshi enclaves inside India are Bangladeshi citizens. However, since they are cut off from their national governments, they are effectively marooned and stateless.

The Indian enclave of Dahala Khagrabari, for instance, is completely encircled by a Bangladeshi enclave, which, in turn, is surrounded by a larger Indian enclave located in the Panchagarh district of Bangladesh.

“For an outsider, it is difficult to know who is a Bangladeshi or who is an Indian here. Even we get confused. Only some concrete pillars mark which part is Bangladesh and which is India,” Rabbul Alam, a resident of Dahala Khagrabari, told Agence France-Presse.

Under the complex provisions of the new agreement, residents on either side of the boundary were given the option to choose where they want to live and the nationality they prefer. According to local media reports, nearly 600 people are preparing to leave Bangladesh and migrate to India.

The entire process, including the physical exchange of enclaves and boundary demarcation, is expected to be completed by June 30, 2016.