In a last attempt to save his life doctors gave desperately-ill Lewis Goodfellow Viagra.
The baby weighed only 1lb 8oz when he was born 16 weeks premature with seriously underdeveloped lungs.
The male impotence drug worked by opening some of the small blood vessels in the lungs to help carry oxygen around the body in his blood.
Now, after five months in hospital, Lewis is at home with his parents Jade Goodfellow and John Barclay, weighing 10lb 7oz and making excellent progress.
"He really is a miracle baby and we decided we would never give up hope until he had taken his last breath," said Jade, 17, who lives with Mr Barclay, a lifeguard, in Walker, Newcastle.
"At one point we were told we might have to make a decision about stopping treatment because he was so poorly and we even started to plan his funeral, but everyone prayed so much for him and he pulled through.
"All the nurses, doctors and consultants were fantastic, and when they tried Viagra it was very much a last resort but it worked.
"When Lewis came home it was wonderful. We were able to finally be a proper family and take him out in the pram."
Lewis was one of the first babies to be given the drug, also called Sildenafil, at the Royal Victoria Infirmary's special baby care unit in Newcastle.
Alan Fenton, consultant neonatologist at the infirmary, said: "Sildenafil is a fairly new form of treatment which we've been using on the unit for around a year.
"It has been used successfully in full-term babies but it is unclear whether it works as well in very premature babies. So far we've used it in around six premature babies." Lewis was due on December 1, but Jade unexpectedly went into labour at just 24 weeks, and her baby was born on August 16.
When Lewis was three weeks old, he needed open heart surgery to correct a faulty valve, but doctors became increasingly worried about his lungs. Although Lewis was being given maximum supplies of oxygen, his lungs were still struggling to get it into his blood supply.
At this point they tried Viagra through a drip and Lewis started to improve. He was still not out of the woods, however, and in November he had laser surgery on his eyes.