A Spanish prisoner who was declared dead by multiple doctors began snoring on the autopsy table just as a pathologist was preparing to begin cutting, according to news reports.

Gonzalo Montoya Jimenez, 29, was jailed in northern Spain when he was found unconscious in his cell Sunday, according to Live Science. Three forensic doctors reportedly examined him and determined that he had died.

Prison officials told Spanish news outlet La Voz de Asturias that Jimenez was found sitting in a chair, showing signs of death, including discoloration of his face and what appeared to be rigor mortis, or the stiffening of a body shortly after death.

"Officials, seeing the cyanotic prisoner blue, alerted the medical services," one official told the outlet. "All signs pointed to the prisoner being dead."

Four hours later, however, Jimenez started making noise while on the slab at the morgue and the pathologist found that he was still alive, Live Science reported. He was taken to the Central University Hospital of Asturias in Oviedo, where he remained in the intensive care unit through the week.

Jimenez's family told La Vos de Asturias that he suffers from epilepsy. They believe that, being jailed, he may not have been able to take his medication properly.

It is unclear if his epilepsy contributed to the episode.

Live Science reported that some people with epilepsy can suffer episodes of catalepsy, described as a trancelike state in which they become unresponsive to stimuli and their muscles become rigid. That rigidity may have been taken to be rigor mortis in Jimenez's case.

Catalepsy can also result in a slowing down of vital signs until they’re nearly imperceptible.

La Voz de Asturias reported that the first thing Jimenez did upon regaining consciousness was to ask for his wife. Doctors at the hospital told his family that his ability to talk and remember his past are good signs, but it is too early to determine if a lack of oxygen will result in permanent problems.

Prison officials are investigating how all three doctors who examined Jimenez found no signs of life.