Kerr McGrath was born with a double inlet/double outlet right ventricle, a condition that affects just five in 100,000 people. When he was only a few days old his mother, Margaret O'Malley, and father, James McGrath, were given the option by doctors to let him slip away.
But the couple wanted to give their child a fighting chance and now he is confounding expectations by starting at St Paul's Primary, in Shettleston, Glasgow.
His first day comes just five weeks after he had an eight-hour open heart operation. Ms O'Malley said: "We're so proud of Kerr as he starts school. It's a day we thought we might not see, so it's so wonderful how well he's done. We've spoken to the school to explain that Kerr needs extra care and they have been great about it. He's looking forward to his first day."
Although Ms O'Malley, from Glasgow, had a healthy pregnancy, Kerr was born one month early and taken straight into the neonatal unit at the Princess Royal Maternity Hospital.
Doctors suspected all was not well with the infant and a heart scan confirmed their fears. At three days old Kerr was moved to the Royal Hospital for Sick Children at Yorkhill to see a heart specialist.
Ms O'Malley, 35, said: "When doctors said he was missing a chamber in his heart, it came completely out of the blue. We didn't even know babies could have heart problems like this.
"My previous two pregnancies were small babies, so I was scanned regularly throughout my pregnancy with Kerr and everything seemed fine until he was born one month early.
"The most difficult thing, really, was the shock, as there was no sign of it during my pregnancy. Sometimes it is diagnosed while the baby is in the womb so, even though it's still terrible, at least those parents have the chance to come to terms with it."