Graeme and Kerry Healey were told baby Millie was too weak for surgery after being born on May 31 weighing just 4lbs 15oz and suffering from acute heart problems.
But desperate parents Graeme, 41, and Kelly, 38, rushed her to another hospital for a second opinion and their little girl is now on the mend after two ops to her heart.
Graeme, from Coney Hill, Gloucester, said yesterday: â€œTo go from being told your child has no chance at all of survival to being where we are now is nothing short of a miracle.
â€œWe are so grateful. If it was not for the hospital staff we wouldnâ€™t have our little girl. Weâ€™d be getting over a funeral instead.â€
Problems during Kerryâ€™s pregnancy forced medics at St Michaelâ€™s Hospital in Bristol to induce Millieâ€™s birth four weeks early and doctors diagnosed a condition called cyanotic univentricular heart, which meant her heart arteries and both ventricles were formed back to front.
Millie was transferred to Evelina Childrenâ€™s Hospital in London, where tests revealed the full extent of the problems and doctors said they could not treat her.
But rejecting advice that all that could be done was to make their daughter comfortable, Graeme and Kerry refused to give up hope and turned to Birmingham Childrenâ€™s Hospital for help.
There, surgeons carried out a four-hour procedure to stabilise Millieâ€™s condition, giving her the chance to grow.
Five weeks later she had a second operation â€“ the first stage of fixing her defective right ventricle â€“ during which medics also strengthened her pulmonary artery and rebuilt part of her aorta.
And now, even though Millie will need more surgery in future, doctors hope she will be home by the end of summer.
Dad Graeme said: â€œThat will be the perfect moment for us.â€
The Evelina Childrenâ€™s Hospital said yesterday: â€œWe are delighted that Millie has had successful surgery. This was a very complex case and we are unable to comment further without the familyâ€™s permission.â€