Indian Prime Minister Narendra Modi began a two-day visit to Bangladesh on Saturday to seal a land agreement between the two countries that would allow tens of thousands of people who are currently stateless to gain citizenship in either country. Modi is expected to ratify the deal with his Bangladeshi counterpart Sheikh Hasina in Dhaka.

The historic agreement calls for exchanging over 150 enclaves of land and residents can choose to be part of either nation. These enclaves, along the 2,500-mile border, have been in place since colonial times, and have remained a contentious issue between the neighbors. Those currently inhabiting these areas are stateless and effectively cut off from public services, Al Jazeera reported. Around 50,000 people are thought to live under these conditions.

More than 50 enclaves in India are inhabited by thousands of Bangladeshis, while Indians live in around 100 areas within Bangladesh, the BBC reported.

Under the agreement, territories in the Indian states of Assam, Tripura, Meghalaya and West Bengal will be exchanged, while enclaves on Bangladesh's side are located in Rangpur Division and Cooch Behar district.

Modi compared the deal to the dismantling of the Berlin Wall, calling it a “watershed moment in our ties with Bangladesh.”

Bangladesh's Foreign Minister Abul Hassan Mahmood Ali called it "a historic milestone in the relationship between the two neighboring south Asian countries,” Reuters reported.

A decision to swap the enclaves was taken in 1974 by former Indian prime minister Indira Gandhi and Bangladeshi leader Sheikh Mujibur Rahman. However, the move was stalled after Rahman's assassination in 1975.

During his visit, Modi is also expected to sign a host of trade agreements. In a separate Friday meeting, Bangladesh’s central bank governor Atiur Rahman reportedly called on Indian firms to take advantage of the country’s low-cost manufacturing base.