Prior to the surgery doctors had said there was only a 50 percent chance of both of the twins surviving.

Bangladeshi twins who were joined at the head were recovering Friday after Hungarian surgeons performed a marathon 30-hour operation to separate their skulls and brains.

The three-year-old twins, named Rabeya and Rukaya, suffered from a rare embryological disorder affecting an estimated one in every five to six million births.

They were "stable after the final separation," said Andras Csokay, a neurosurgeon with the Action for Defenceless People Foundation (ADPF) that organised the 35-strong Hungarian surgical team.

After the separation at Dhaka's Combined Military Hospital, Csokay's team began to cover the wound area with soft tissues generated by a tissue expansion process carried out in Hungary.

Rafiqul Islam, the father of the twins, was relieved and overjoyed.

"The doctors have separated my babies. I have seen them with my own eyes. They are now fine," said Islam, a teacher from the rural northwestern district of Pabna.

He praised the doctors and added: "I hope my daughters will fully recover and grow up healthy and have a normal life."

Before the surgery doctors had said there was only a 50 percent chance of the twins surviving.

According to ADPF, only a handful of operations to separate twins joined at the head have been successful.

The Hungarian charity was set up in 2002 by Csokay and plastic surgeon Gergely Pataki to provide free surgery to poor people in Hungary and abroad.

Islam and his wife approached the group for help in 2017.

In the first surgery phase in Bangladesh last year, the shared blood vessels of the twins' brains were separated in a 14-hour operation.

Then in a second six-month-long phase beginning in January, Rabeya and Rukaya moved to Budapest where doctors inserted an implant system to expand the scalp and soft tissue in their heads.

More than 40 plastic surgery interventions took place to fill the expanders, change the bandages and to perform laser and regenerative wound treatment.

ADPF neurosurgeons and plastic surgeons supported by anaesthesiologists, radiologists and pediatricians also used innovative 3D animation software to map the two brains.

"This was one of the biggest most challenging malformations that I have ever seen," Pataki told AFP last month.

The twins and Hungarian medics returned to Bangladesh in late July ahead of the final surgery.

ADPF has performed around 500 reconstructive surgery operations in Asia and Africa, including for Rohingya Muslim refugees in Bangladesh.