DHAKA - Bangladesh and India on Saturday sealed a historic land pact to swap territories, which will finally allow tens of thousands of people living in border enclaves to choose their nationality after decades of stateless limbo.
Foreign secretaries of the two nations signed a protocol and exchanged instruments of ratification to make operational the Land Boundary Agreement (LBA) in the presence of visiting Indian Prime Minister Narendra Modi and Bangladeshi premier Sheikh Hasina.
The two premiers also inaugurated two bus services connecting the Bangladeshi capital with four eastern India cities as part of a raft of deals the two countries are expected to sign to deepen bilateral ties.
Modi's first trip to Dhaka since his election win last May has been dominated by the deal to fix permanently the contours of a border which stretches some 4,000 kilometres (2,500 miles) along India's eastern flank.
While Delhi's relations with China and Pakistan continue to be dogged by border disputes, the LBA's ratification removes a thorn that has troubled relations between the two countries since Bangladesh's 1971 war of secession from Pakistan.
India's intervention on behalf of the independence fighters proved decisive in that conflict and successive Bangladeshi governments have enjoyed close ties with their giant neighbour.
But an agreement on the ownership of 162 enclaves - essentially islands of land resulting from ownership arrangements made centuries ago by local princes - had proved elusive in the decades since.
Bangladesh actually endorsed the deal in 1974 but it was only last month that India's parliament gave its approval, teeing up Saturday's joint ratification ceremony between Modi and his counterpart Sheikh Hasina.
Under the agreement, the countries will exchange territories, with 111 enclaves being transferred to Bangladesh and 51 to India.
People living in the enclaves will be allowed to choose to live in India or Bangladesh, with the option of being granted citizenship in the newly designated territories, and the enclaves would effectively cease to exist.
Around 50,000 people who are thought to live in the landlocked islands lack many basic services such as schools, clinics or utility services because they are cut off from their national governments.
Modi, who was received by Hasina at the airport, has compared the agreement to the dismantling of the Berlin Wall, saying it marks "a watershed moment in our ties with Bangladesh".
Bangladesh has been similarly effusive, with Foreign Minister A.H. Mahmood Ali stating it "would open a new chapter" in ties.
India's Foreign Secretary S. Jaishankar said the deal would help combat smuggling of people, drugs and illegal currency.
"The enclaves in the past have been territories out of bounds for law enforcement agencies. Often they have been misused to seek refuge by elements who have been undermining law and order," he told reporters.
"So the clarity and discipline, which will come from the clearly demarcated borders will help the land border between the countries much more secure." Wary of China's growing interest in India's backyard, Modi has been keen to play a greater leadership role in South Asia since coming to power.
Officials on both sides said Modi's visit would see the signing of around 20 agreements aimed at boosting trade and transport links, including deals on the movement of goods across borders and rail projects.
Just an hour after Modi's arrival, top Indian conglomerates Reliance Power and Adani signed outline agreements with Bangladesh's state-run electricity agency to invest some $5 billion in the country's rickety power sector.
"Top officials of Bangladesh's Power Development Board (PDB) and those from Reliance Power and Adani signed the deals in Dhaka to generate 4,600 megawatts of electricity," PDB spokesman Saiful Hasan told AFP.
But a breakthrough in a dispute about the sharing of water from the Teesta river which flows through both nations is not expected.
Modi's talks with Bangladesh opposition leader Khaleda Zia on Sunday will also be closely watched by observers, with her long-running calls for fresh elections having gained little traction.
Indian officials have played down the idea of Modi playing a mediation role in the dispute between Hasina and Zia, although he might press on Zia to ensure an end to anti-government attacks.
Scores of people have been killed in firebomb attacks on vehicles since Zia called a transport blockade at the start of the year in a bid to topple Hasina.
India held off from criticising Hasina's re-election in January 2014 in a contest that was boycotted by the opposition and dismissed as "not credible" by Western nations.