The Wednesday execution of a Missouri prisoner was stayed by a federal judge on Tuesday over claims from the convicted murderer's lawyers he is both innocent and is mentally incompetent.

U.S. District Judge Catherine Perry ruled that John Middleton should receive a hearing over claims he is not mentally competent to be executed, Reuters reports. The 54-year-old man has provided "a substantial threshold showing of insanity."

Middleton's lawyers have also claimed that the former meth dealer did not commit three drug-related murders in 1995, which prosecutors tied to him saying that he wouldn't allow them to provide information to police.

His lawyers argue otherwise, saying that the murders were carried out by other meth dealers as acts of revenge.

They also said that at his trial, perjured testimony was allowed and evidence in Middleton's favor was not allowed.

For now, his lawyers are fighting to keep him from being executed as he is not mentally capable of understanding why he is being put to death. According to The Guardian, a psychiatrist backed up their assertions saying Middleton "lacks a rational understanding of the reason for the execution and is therefore not competent."

Perry also said that in addition to dealing meth, Middleton also used and his mental health has continued to worsen over the nearly two decades on death row. Inmates notes that he "frequently talks to people who are not there, and tells stories that could not have any basis in reality."