In a first for the UK, a baby girl born with her heart outside her body has survived against all the predictions of her doctors. After three weeks of life and three operations, her heart has been moved back inside her chest.

Vanellope Hope Wilkins was born with the rare condition ectopia cordis, where the heart isn't in its normal place in the thorax. It affects as few as just five babies out of a million births, and the survival rate is less than 10 percent.

In this case the condition was discovered at the 9-week scan, and parents Naomi Findlay and Dean Wilkins were advised that termination was the only option. Instead, they decided to let nature take its course, and Vanellope has defied the odds to pull through.

The first promising sign came when Vanellope was born by caesarean section "shouting her head off", because being able to breathe normally is crucial for survival.

"When she came out and she came out crying, that was it," Findlay told Caroline Davies at The Guardian. "The relief fell out of me."

Almost immediately the baby was placed into a sterile bag to guard against infection and to keep the beating heart moist while it remained outside the body.

A team of 50 staff at Glenfield Hospital in Leicester have since performed three operations on Vanellope, the first of which was less than an hour after she was born.

The second, after a week, made room inside the baby girl's tiny chest for the heart to take its normal place. With the help of gravity, the organ has gradually slid into position alongside the lungs.

Designed to help protect the fragile heart, the latest operation took skin from under Vanellope's arms and patched up her chest with it. She remains in a very delicate condition and attached to a ventilation machine.

The doctors say more challenges for Vanellope lie ahead, but her prospects are now looking a lot better. As she was born without a breastbone, that's one issue the medical team needs to address.

"In the future we may be able to put in some internal bony protection for her heart – perhaps using 3D printing or something organic that would grow with her," consultant paediatric cardiologist Frances Bu'Lock told Fergus Walsh at the BBC.

A handful of babies are known to have survived being born with ectopia cordis, which literally means "out-of-place heart", including Audrina Cardenas from Texas in the US, who was born in October 2012.

Audrina was born with a third of her heart outside her chest. After surgery to repair the defect, she was sent home after three months.

For Vanellope's parents, their little girl's progress justifies their decision to continue with the pregnancy, as well as being a testament to the hard work and expertise of the medical team at Glenfield Hospital.

"The moment she was born I realised that we had made the right decision," says dad Dean Wilkins. "We know this is going to be a rollercoaster and have started to prepare ourselves for the difficult times ahead, but we needed to give her a chance, and the team here have done that."

"Some mums still terminate and if we can get out there that there is a hope, and that it can be done, then it's giving all those mums out there a chance," Wilkins told The Guardian.

And if you're wondering about the name, it's after Vanellope von Schweetz from the Disney movie Wreck-It Ralph – another girl who overcomes all odds to pursue her dreams.