A 50-year-old homeless man who was declared dead by a doctor at Lokmanya Tilak Municipal General Hospital in Mumbai, India, shocked the mortuary staff when he woke up minutes before his autopsy, the BBC reports.

According to the Straights Times, the man, identified only as Prakash, was sent to the mortuary immediately after being declared dead — the hospital’s rules require patients remain in the hospital for at least two hours after their time of death in case of an error like this.

Dean of the hospital Dr. Suleman Merchant told the BBC that Prakash must have been “lying around for at least six or seven days” prior to being brought in, as he had maggots on his face and in his ears: “Maggots eat human tissues. Usually dead bodies have maggots.” He also said he is launching an investigation as to why hospital protocol was breached.

As soon as the mortuary attendant noticed Prakash breathing, the Indian Express reports he administered CPR and was able to stabilize Prakash to get him to the ICU. Prakash is reportedly delirious from a metabolic condition but currently stable.