A man has survived against the odds after a heart attack which caused his heart to stop beating for 18 minutes.
Doctors say people can normally survive for up to four minutes after they stop breathing. They are likely to die or suffer serious brain damage after that.
But Rob Waggett, 31, of Newport took a breath after paramedics used a defibrillator seven times to shock him.
Doctors told his wife he survived because his heart kept on quivering four times longer than normal.
His wife Dianna said: "It's a miracle."
He was allowed home on Sunday but his short-term memory has been affected by the ordeal.
Father-of-two Mr Waggett had gone to bed with flu-like symptoms when his wife heard him struggling for breath through a baby monitor on the upstairs landing.
But by the time she reached him, he was taking his last breaths.
"I said my goodbyes and told him I loved him and then watched as he died in my arms," she said.
Mrs Waggett, 29, dialled 999 and was told to try to resuscitate him.
She shouted to her next-door neighbour, Gary Thompson, and the pair performed CPR for four minutes while they waited for an ambulance.
Paramedics used a defibrillator to shock his heart six times without success and decided to try him one last time.
It was then - 18 minutes after he stopped breathing - that Mr Waggett gasped for air.
He was taken to hospital where he was put into a medically-induced coma.
Doctors warned Mrs Waggett that even if he pulled through, her husband was likely to have suffered serious brain damage if he survived the next 48 hours.
She said: "I started grieving because I thought there was no hope, I didn't know what I was going to tell our two young sons."
He came around three days later but because his brain had been starved of oxygen he didn't recognise Dianna who was keeping a bedside vigil.
But the next day he woke up and asked nurses: "Why is my wife sleeping on the floor?"
Mr Waggett, a team manager with Caerphilly council, gradually began to piece together his long-term memories and three days later was well enough to see his children, three-year-old Mylo and Koby, one.
Doctors at the University Hospital of Wales, Cardiff, have given him a pacemaker but have not been able to discover why he suffered the heart attack.
They told Mrs Waggett that her husband's heart unusually kept on quivering four times longer than normal, giving paramedics the time they needed to save him.
"I am so grateful that the paramedics carried on working on him," said Mrs Waggett, who added that her 6ft 6in (1.98m) husband did not smoke and had been fit leading up to the heart attack.
"They didn't just save Rob's life, they've saved mine and the children's as well."
The Welsh Ambulance Services NHS Trust has praised paramedic Gary Evans, 45, and his colleagues Dan Faulker and Alan Hodge.
A spokesman said it was unheard of for a patient to be revived after 18 minutes without breathing.
But they were able to confirm the time from Mrs Waggett's 999 call from the family home in Malpas, Newport.
Paramedic Gary Evans, of Pontypool, said: "We were called out to a report of a man with a heart attack - he had stopped breathing and it wasn't looking good.
"He was gone for 18 minutes.
"It's great to know that we've kept him alive and his family together."