India and Bangladesh have swapped control of some 160 small pockets of land on each other’s territory.
The enclaves, home to some 50,000 people, were created through local peace treaties in the 18th Century.
New national flags were to be hoisted as a landmark accord between the two countries came into effect at midnight local time on Friday.
Residents were asked to choose where they wanted to live and which nationality they would prefer.
Most of the people living in the enclaves – 111 in Bangladesh and 51 in India – will stay where they are, but change nationality.
The enclaves endured through British colonial rule and the independence first of India and more recently Bangladesh.
After the partition of India in 1947, their inhabitants remained where they were – residents of one country but located inside the other, the BBC’s Sanjoy Majumder reports.
For six decades they have been treated as in effect stateless, but the agreement between India and Bangladesh means they will now finally gain a proper identity.
Hitherto residents have had difficulty getting access to basic facilities such as education.
Faces from the enclaves: Amitabha Bhattasali
In the Moshaldanga enclave, a five-year-old boy named Jihad Hussein Obama epitomises the freedom its citizens hope to experience now that the territories have been swapped.
He is the first child to be born at an Indian hospital – with his real parents’ name and location on the records.
Bangladeshi enclave dwellers have had to usually fabricate their names and addresses to get treatment at Indian hospitals or even get admitted to Indian schools and colleges.
His mother, Asma Bibi, said: “I was in labour pain and my husband took me to a hospital at closest Indian town of Dinhata. But the doctors refused to even see me saying I am a Bangladeshi and I am not supposed to get treatment there. I decided not to hide my identity that I am from an enclave.”
A verbal duel ensued which finally saw thousands of enclave dwellers gathered at the hospital.
“After much pressure, my wife was admitted and Jihad was born – with our names registered at the hospital as his parents. This is the first time a baby was born in the enclaves with his real parents’ name. Even my two elder kids were born with someone else’s name as their parents. Officially I am not their father”, said Shahjahan Sheikh.
The overwhelming majority of people living in Indian enclaves in Bangladesh opted for Bangladeshi citizenship, AFP news agency reported.
But nearly 1,000 chose to keep their Indian nationality, meaning they will leave their homes by November for India and be resettled in the state of West Bengal.
In India, all the Bangladeshis living in the 51 Bangladesh enclaves decided to switch nationalities.
Bangladesh endorsed a deal with India in 1974 in a bid to dissolve the pockets, but India only signed the final agreement in June when Prime Minister Narendra Modi visited Dhaka.