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.
"When Choity arrived in Australia, she was very malnourished, she couldn't walk properly at all," said Kimber.
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.
Surgeons spent countless hours examining her under anaesthetic and found she had two rectums, anuses, vaginas and uteruses. She was also incontinent.
'She's pretty good'
The surgery, which Kimber said was "extremely rare", was finally carried out in November and involved eight doctors who specialise in genital and pelvic reconstructions working on the girl for eight hours.
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.
The little girl is also partially blind, but an ophthalmologist's examination at the hospital found her sight could not be improved.
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.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)