A prisoner certified dead by three doctors was reportedly found to be alive just hours before his post-mortem.

Gonzalo Montoya Jimenez, an inmate at a jail in Asturias, northern Spain, was put in a body bag and transferred to a hospital mortuary after he was discovered collapsed in his cell, according to Spanish media.

Jimenez’s family said he “had autopsy markings on him, ready to be opened up".

The Forensic Anatomical Institute of Oviedo only realised the prison doctors' mistake when the 29-year-old was heard snoring on the autopsy table, reports La Voz de Asturias.

Jimenez is now under observation in intensive care at the Central University Hospital of Asturias (HUCA), Oviedo.

After regaining conscious 24 hours later, the first thing he did was ask about his wife, according to the newspaper.

The incident is suspected to be a case of catalepsy; a condition characterised by rigidity of the body, a loss of responsiveness to pain and a slowing down of bodily functions, such as breathing.

Doctors feared brain damage, but said signs were positive after he talked and was able to remember his wife.

Jimenez’s family said he has epilepsy and was on medication, but feared he had not been taking it at the right times in prison.

The Independent has contacted Spain’s General Secretariat of Penitentiary Institutions for comment.