(CNN) An Iowa inmate serving a life sentence says he should be a free man after he became ill, momentarily died, and had to be revived at the hospital. But the courts are having none of it.

Benjamin Schreiber was sentenced to life in prison without parole in 1997 after being convicted of first-degree murder. In March 2015, he developed large kidney stones that led to septic poisoning, according to court documents.

He eventually fell unconscious in his cell and was taken to a local hospital, where he was resuscitated five separate times, the documents say.

According to the Iowa Court of Appeals, Schreiber "claims he momentarily died at the hospital, thereby fulfilling his 'life' sentence ... Because his sentence has been fulfilled, he argues, he is imprisoned illegally and should be immediately released."

A district court previously denied Schreiber's motion. And on Wednesday, the Iowa Court of Appeals upheld the lower court's decision.

Read More