By Agence France-Presse
The 10-month-old was returned to her mother in emotional scenes after a court in Chittagong ruled the child had been taken without her permission and sold to a childless couple.
"I am extremely happy that I got my daughter back," the girl's mother, Nusrat Jahan, told AFP.
"I could not sleep all these months after she was snatched from my lap."
Jahan launched legal action in April after suspecting her husband's role in their daughter's disappearance.
Her husband, a methamphetamine addict, is accused of stealing the baby from the couple's home Halishahar, a neighbourhood in Chittagong.
He has been detained and will face charges relating to kidnapping and selling the infant.
Court clerk Mohammad Yusuf said there were emotional scenes as the baby was taken from her adopted parents and given to her biological mother.
"The child was reluctant to leave her adopted mother, as she has nursed her well," Yusuf said.
"Both the baby and the adopted mother burst into tears as the child was reunited with her mother."
Jahan, 20, said the adopted parents were welcome to visit the child.
"I told her my door is always open," she said, referring to the adopted mother.
Drug use has flourished in Bangladesh in recent years, with a blend of methamphetamine and caffeine known locally as yaba especially popular among youth.
Experts say millions are hooked on the highly-addictive stimulant, which is smuggled into Bangladesh from Southeast Asia.