LONDON (Reuters) - Two-year-old twins joined at the head have undergone successful surgery at a British hospital to separate their skulls, brains and blood vessels, doctors said on Tuesday.

The highly complex surgery involved multiple operations on Safa and Marwa Ullah, who were born in Pakistan in January 2017 with a condition known as “craniopagus” in which the girls’ skulls and parts of their brains were joined and intertwined.

“Craniopagus is an exceptionally rare and complex condition,” said David J. Dunaway, who co-led the surgical team that treated the twins. The operation, conducted in February, was the most complex such separation his team had performed to date, he said.

Having twins joined at the head with fused skulls and separate bodies occurs in less than one in a million births, while having the connection extend into the brain tissue is rarer still. Around 50 sets of craniopagus twins are estimated to be born around the world every year, of which only around 15 are thought to survive beyond the first 30 days of life.

Dunaway said this separation was helped by state-of-the-art technology including virtual reality, advanced imaging and three-dimensional rapid prototyping - allowing the surgeons to use images of the girls’ brains and blood vessels to plan and practice the surgery in advance to minimize complications.

The procedures took place at London’s Great Ormond Street hospital, with the girls well enough to be discharged from hospital four months later on July 1.

“These cutting-edge scientific techniques greatly increased the chance of success for Safa and Marwa. Their brains were more intertwined than the previous sets of craniopagus twins making it the most complicated separation to date,” the Great Ormond Street team said in a statement.

Five months after their final operation, Safa and Marwa are making slow but steady progress, the doctors said, adding that “a further period of recuperation and rehabilitation is essential to maximize their recovery”.