A hospital doctor in the city of Babahoyo declared Bella Montoya, 76, died following a suspected stroke.
She was placed in a coffin and taken to a funeral parlour, where relatives held a vigil before her planned burial.
When, after almost five hours, they opened the coffin to change her clothes ahead of the funeral, the woman gasped for air.
“My mum started to move her left hand, to open her eyes, her mouth; she struggled to breathe,” her son Gilbert Balberán described the moment he realised his mother was still alive.
Video taken by a mourner shows her lying in an open coffin struggling to breathe, while another complains that an ambulance they called has not yet arrived.
Minutes later, firefighters arrive and lift Bella Montoya onto a stretcher and take her back to the hospital where she had been declared dead.
Her son told Ecuadorean media that she was in intensive care, but was responsive.
“My mum is on oxygen, her heart is stable. The doctor pinched her hand and she reacted, they tell me that’s good because it means she is reacting little by little,” newspaper El Universo quoted him as saying.
Mr Balberán said he had taken his mother to the hospital at about 09:00 “and at noon a doctor told me [she] died”.
He said a death certificate had even been issued, stating that she had suffered cardiopulmonary arrest after suffering a stroke.
Bella Montoya is not the only person to “come alive” after being officially declared dead.
In February, an 82-year-old woman was found to be breathing while lying in a funeral home in New York State. She had been pronounced dead three hours earlier at a nursing home.
Dr Stephen Hughes, a senior lecturer in medicine at Anglia Ruskin University’s School of Medicine in Chelmsford, says such cases are very uncommon but he points out that “death is a process”.
“Sometimes somebody may look like they’re dead but they’re not quite dead,” Dr Hughes told the BBC. “Careful examination is necessary to confirm death.”
The consultant in emergency medicine says that if patients don’t respond and have no pulse, doctors listen for heart sounds and watch for breathing effort for at least a minute. “If that’s all absent then you can say they’re dead.”
But it may be hard even for health professionals to determine that someone has died – for example when bodies are very cold. “The patient in such instances will have an almost imperceptibly slow heart rate and their bodies will have shut down,” Dr Hughes says.
Some drugs can also slow down body processes, giving the appearance of death, he adds. Such “confounding factors” can happen if the examination is carried out in a cursory manner or under time pressure.
Ecuador’s health ministry has set up a committee to investigate the incident.