Advances in open fetal surgery and other prenatal procedures enable doctors to treat more conditions before a baby is even born.

Lynlee Boemer, now almost 5 months old and “hitting all her milestones,” has much to celebrate.

When Lynlee’s mother was 23 weeks and 5 days into her pregnancy, doctors at Texas Children’s Hospital in Houston performed open fetal surgery to remove a rare tumor from the base of the infant’s tailbone.

If the tumor — which was competing for her blood supply — was allowed to continue growing, it could cause her heart to fail.

To give Lynlee a fighting chance, doctors opened up her mother’s womb and took out the fetus. After removing 90 percent of the tumor — known as a sacrococcygeal teratoma — doctors placed Lynlee back inside and sewed up the uterus.

Throughout the procedure Lynlee remained connected to her mother’s blood flow through the umbilical cord.

Without surgery Lynlee would have likely died, but operating carried its own risks.

Lynlee’s heart stopped during surgery and had to be restarted. She also needed a blood transfusion. And with an increased risk of rupture of the uterus and preterm labor after surgery, her mother had to spend 12 weeks on bedrest.

At 36 weeks into the pregnancy, Lynlee was born via cesarean delivery. She weighed 5 pounds, 5 ounces.

Doctors removed the rest of the tumor when Lynlee was 8 days old.

Read more: What is fetal ultrasound? »

In the early 1980s doctors were first starting to think about ways to fix these kinds of life-threatening conditions before a baby was born, rather than taking the chance of waiting for a full-term delivery.

“The idea of fixing something before birth 30 years ago — or a little bit more than that — was just outrageous,” Dr. N. Scott Adzick, surgeon-in-chief of the Children’s Hospital of Philadelphia, and the director of the Center for Fetal Diagnosis and Treatment, told Healthline.

During early work in fetal sheep and monkeys, doctors developed technologies that would increase success rates of fetal surgeries.

This included a uterine stapling device that allowed them to open the uterus without excessive bleeding as well as ways to minimize the risk of preterm labor after surgery.

Around that time, good fetal ultrasound enabled doctors to see birth defects in the fetus for the first time.

This led to the first successful fetal surgery for sacrococcygeal teratoma in 1996, performed by Adzick and colleagues at the Children’s Hospital of Philadelphia. Since then only 15 have been performed worldwide.

Although this type of procedure is rare, open fetal surgery itself is more common.

Surgeons at the Children’s Hospital of Philadelphia (CHOP) have performed 1,432 fetal surgeries since 1995. More than 300 of those were open fetal surgery for sacrococcygeal teratoma, spina bifida, and a type of lung tissue mass.

UCSF, Vanderbilt, Cincinnati Children’s Hospital and other centers around the country and world also offer open fetal surgery.

Read more: A parent’s emotional agony when an infant undergoes heart surgery »

In the early years, doctors focused on the most desperate cases, largely because of the risks involved with open fetal surgery.

But as surgical techniques improved, surgeons started to treat other conditions, such as spina bifida.

This birth defect can cause the baby’s spinal cord to be exposed along the lower back. When the nerves of the fetus are open to the amniotic fluid — what’s called a myelomeningocele — it can damage the nerves. This can cause weakness in the muscles of the legs or problems in the bowel and bladder.

In the 1990s, Adzick and colleagues performed open fetal surgery on sheep with a spina bifida-like condition. After birth, sheep whose exposed spinal cord had been repaired could walk and even go up stairs.

This led to a large-scale clinical trial in people called the Management of Myelomeningocele Study (MOMS). Through this trial, researchers found that the benefits of surgery outweighed the risks, even for a condition that was not immediately life-threatening.

Doctors also have other fetal surgery procedures available to them, including the less invasive fetoscopy, which allows them to intervene on the fetus through very small endoscopes.

Fetoscopy is used to treat abnormal blood vessels in twins, defects with the umbilical cord, and a type of hernia that affects the windpipe of the fetus.

“There’s lots going on,” said Adzick. “It is not a static field by any means.”

Researchers are also exploring the use of bone marrow stem cells to treat fetuses with sickle cell disease as well as new ways to treat spina bifida earlier.

“In the future you might be able to treat [spina bifida] with a tissue-engineered approach that will seal the lesion,” said Adzick, “and then you can do the repair after birth.”

As the field progresses, the successes extend well beyond technical developments. Each year, CHOP has a reunion for children who underwent fetal surgery and their families. Close to 2,000 people attended this year’s event.

“To see those children — who might not have been with us — with their families, and growing and developing in a normal way, that’s just astounding,” said Adzick. “That’s one of the things that keeps us going and keeps us motivated.”