Three-year-old Choity Khatun was given little prospect of survival until she was brought to Melbourne last year by Australian charity Children First Foundation.
A team of surgeons spent several months mapping out a procedure to reconstruct her anatomy.
"A twin had grown out of her pelvis but the twin was only part of a twin... The problem is there's no rulebook for this because she's a very unique individual so you have to try and work out what was where," Chris Kimber, the paediatric surgery head at Monash Children's Hospital, told AFP.
Working in consultation with experts from Europe and the United States, the surgeons planned a procedure that involved removing the remains of the third leg -- part of which was earlier cut off in Bangladesh -- as well as taking out, disconnecting and reconnecting other organs.
More From This Section
Choity's condition meant that body parts from a twin developed in her perineum -- the area between the anus and the vulva.
Surgeons spent countless hours examining her under anaesthetic and found she had two rectums, anuses, vaginas and uteruses. She was also incontinent.
"We spent three or four months thinking about it, presenting it to other doctors, getting ideas from around the world, and then based on lots of world opinion, we were able to come up with something that clearly works," he added.
A key triumph for the surgeons, including Kimber, was that they were able to help her become continent, which Kimber said was "extraordinary".
"She's pretty good," he added.
But she has sufficient sight to now walk and run like other children, to the delight of her 22-year-old mother.
"Everything is good now... She can play like every baby," Shima Khatun told broadcaster Channel Nine on Thursday, adding that she was looking forward to returning to her village outside Dhaka with her daughter and being reunited with her husband.