Doctors realised Maia Collingswood needed the transplant after her father Dan revealed he also had the procedure in 1997.
Maia, from Barmouth, Gwynedd, had the transplant at London's Great Ormond Street hospital in August after a three-month wait for a new heart.
She has now been welcomed back to her school, Ysgol y Traeth.Continue reading the main story
Dan's family, my family, the school, friends and indeed the whole community... Telford have been magnificent and supported us”End Quote Hannah Carter Maia Collingswood's mother Maia, a year five pupil, fell ill at Easter while visiting her grandparents in Telford, Shropshire.
"Maia was out of breath and could not move," said her mother, Hannah Carter.
"She was taken to the local hospital and then transferred to the Birmingham Children's Hospital where a heart problem was diagnosed."
But Maia's father said when he questioned doctors and revealed he had undergone a heart transplant, the medical team realised her condition was serious.
She was transferred to the London Children's Hospital, where surgeons confirmed she also needed a heart transplant.
Her condition continued to deteriorate over the next three months, until she finally received the donor heart she needed on 15 August.Maia returned to Ysgol y Traeth in Barmouth seven weeks ahead of schedule
It was three months of desperate worry for her parents, who are are separated, but remain friends. The local community rallied around to ensure they could spend as much time as possible with their daughter in London.
"Dan's family, my family, the school, friends and indeed the whole community here in Barmouth and in Telford have been magnificent and supported us throughout the summer after Maia was taken ill," said Mrs Carter, who works for the Gwynedd home care team.Collection tins
Mr Collingswood, who works at a private care establishment near Dolgellau, added: "I am with the local lifeboat here in Barmouth and the RNLI helped us out financially when we had to visit Maia in hospital in London.
"The community has been great, there were collection tins everywhere for Maia and it helped us out. We could not have managed without the support of the community."
On Tuesday, Maia was greeted by pupils and the head teacher as she returned to class, seven weeks ahead of schedule.Continue reading the main story
When I was in hospital I met the singer Adele, racing driver Lewis Hamilton, Alexandra Burke from the X Factor and two American astronauts”End Quote Maia Collingswood "Maia would have liked to have gone back to school last week but we had to travel to Great Ormond Street for check-ups," said her mother.
"She asked if she could go back to school after returning home from London and the expert medical team said that it was OK. Maia was delighted."
The long wait for the transplant meant Hannah's mother had to give up her flat in Barmouth to be with her daughter, but she has now moved into a new home with Maia after being rehoused by housing organisation Cartrefi Cymunedol Gwynedd.
Mrs Carther added: "I started back to work this week, Maia has started school, we have a new flat, it is all coming together.
"It has been a long and traumatic summer and without the support of family, friends and the community and the medical team, I don't know how I got through it."
Maia herself said she was delighted to be back in the classroom, and revealed how she had coped with her long stay in hospital.
"I used to talk to my school friends on Skype when I was in hospital in London and the headmaster visited me a couple of times."
She also had a number of special visitors while on the hospital wards.
"When I was in hospital I met the singer Adele, racing driver Lewis Hamilton, Alexandra Burke from the X Factor and two American astronauts, " she said.