Formerly conjoined twins who were once attached at the head were finally discharged earlier this month after undergoing a combined 50 hours of procedures to separate them.

Safa and Marwa Ullah, 2-year-old twins from Charsadda, Pakistan, began the separation process at London's Great Ormond Street Hospital (GOSH) in October.

The girls’ mother, Zainab Bibi, did not even know that she was expecting twins before their January 2017 birth, which is also when doctors discovered the pair were craniopagus twins, according to the hospital’s blog.

MOM SUFFERS SEVERE FOOT BURNS AFTER STEPPING ON SAND UNDER 'COLD' BARBECUE

Approximately 70 percent of conjoined twins are females. About 75 percent of conjoined twins are joined at least partially in the chest and share organs with one another, but craniopagus twins, which are joined at the head, only account for 2 percent, according to Children’s Hospital of Philadelphia (CHOP).

Craniopagus twins typically share large dural sinuses and vascular structures, with the brains rarely separated by bone. In some cases, the two brains are connected, or separated only by a delicate membrane making surgery extremely difficult. Despite advances in medical technology, the rate of complications and death is still high among craniopagus twins with total fusion who share the superior sagittal sinus.

The girls’ care team in Pakistan consulted with GOSH staff before transferring their care, seeking further investigation into whether they could be separated. Their medical team was comprised of craniofacial specialists, neurologists, psychologists, nurses, radiologists and physical therapists. The team first created an exact replica of the girls’ anatomy using 3-D technology to determine the safest way to operate, Sky News reported.

CONJOINED TWINS BORN SHARING SAME HEART IN INDIA: 'SEPARATION IS ALMOST IMPOSSIBLE'

The team then separated the girls’ brain and blood vessels before inserting a piece of plastic between the two, creating two separate kids internally. In a YouTube animation, staff explained how they then inserted tissue expanders to stretch the skin before reconstructing the top of their heads with their own bone and covering the top of their heads with expanded skin.

“It’s been a long and complex journey for them, and for the clinical team looking after them,” Noor ul Owase Jeelani, the girls’ neurosurgeon, and Professor David Dunaway, the girls’ craniofacial surgeon, told Sky News. “From our personal point of view, it has been great to get to know the girls and their family. Their faith and determination have been so important in getting them through the challenges they have faced. We are incredibly proud of them.”

The twins were released from the hospital on July 1 and remain in London under the care of their mother and uncle, Sky News reported. They are still undergoing daily therapies but the team feels they will lead active lives.

CLICK HERE TO GET THE FOX NEWS APP

“We are indebted to the hospital and to the staff and we would like to thank them for everything they have done,” Bibi told Sky News. “We are extremely excited about the future.”