Panetti has been on Death Row in Texas since 1995 and has been diagnosed as schizophrenic.
Panetti's lawyers and attorneys for the state said he was mentally disturbed. The question was whether he was sufficiently mentally ill that it would violate the 8th Amendment, which bars cruel and unusual punishment, to execute him.
Panetti was hospitalized for mental illness 14 times in the decade before using a shotgun to kill his former in-laws in the Texas hill-country town of Fredericksburg, as his estranged wife Sonja and her son watched.
Panetti was ruled mentally competent to stand trial, to represent himself and to be executed. Before Thursday's decision, four courts, including the 5th U.S. Circuit Court of Appeals, rejected pleas by Panetti's lawyers to spare his life.
The case presented a particularly thorny question, because evidence was introduced that Panetti was aware that he had killed Amanda and Joe Alvarado. But expert testimony was presented that Panetti, known as "the Preacher" on Death Row, believed he was going to be executed because Texas was conspiring with the devil to block him from preaching the Gospel to fellow inmates -- not because of the Alvarado murders.
Kennedy found that Panetti's execution would be inconsistent with a 1986 Supreme Court decision that a person should not be put to death if he could not perceive "the connection between his crime and his punishment."
He was joined by Justices John Paul Stevens, David Souter, Ruth Bader Ginsburg and Stephen Breyer.
Dissenting was Justice Clarence Thomas, joined by Chief Justice John Roberts Jr. and Justices Antonin Scalia and Samuel Alito Jr.
The Supreme Court sent the case back to a federal judge in Austin, Texas, to reassess Panetti's mental health in light of the decision issued Thursday. Ted Cruz, the Texas solicitor general, said he would continue to press for Panetti's execution.
The high court's decision was hailed by the National Alliance on Mental Illness, which submitted a friend-of-the-court brief, as did the American Psychological Association and the American Psychiatric Association.
"For once, law has caught up with medical science," said Ronald Honberg, NAMI's director of policy and legal affairs.
"The circumstances of this case are tragic. ... However, execution of someone who is profoundly ill would only compound the original tragedy and represent a profound injustice for us all," Honberg said.