TORONTO -- An Iowa man serving a life sentence for murder lost his appeal for freedom after unsuccessfully arguing that his sentence was fulfilled after his heart had to be restarted five times.

Benjamin Schreiber was hospitalized in 2015 after large kidney stones caused him to develop septic poisoning, according to court records. He was unconscious when he arrived to hospital.

Schreiber had signed a “do not resuscitate” order years earlier, but hospital staff administered fluids through an IV after his brother in Texas said Schreiber should be given something to ease his pain.

According to court documents, the administered medications resuscitated the man five times and ultimately saved his life. The inmate then underwent surgery to repair his organs and recovered.

Three years later, Schreiber filed for post-conviction relief, claiming that his momentary death in the hospital constituted the end of his life sentence and that he was being imprisoned illegally and should be immediately released.

The inmate’s request was dismissed by the district court, which found his claim “unpersuasive and without merit.”

The Iowa Court of Appeals affirmed that decision Wednesday.

"Schreiber is either still alive, in which case he must remain in prison, or he is actually dead, in which case this appeal is moot," Judge Amanda Potterfield wrote in the court of appeals opinion.

She notes that the appellant cited no case law to support his position and that state law requires those convicted of a class A felony to “spend the rest of their natural life in prison, regardless of how long that period of time ends up being or any events occurring before the defendant’s life ends.”

The legislature did not “intend to set criminal defendants free whenever medical procedures during their incarceration lead to their resuscitation by medical professionals,” Potterfield wrote.

Schreiber was convicted of murder in 1997 and sentenced to life in prison without possibility of parole in the death of a man beaten to death with an ax handle.