The Supreme Court on Monday ruled in favor of a convicted murderer who was seeking the right to have an independent expert evaluate his mental health.

Justice Stephen Breyer wrote the 5-4 opinion in favor of the death row inmate, James McWilliams. The opinion reversed a lower court ruling denying McWilliams' request, which the Supreme Court decided was "contrary to, or an unreasonable application of, federal law." Breyer's opinion said McWilliams did not receive the assistance he was entitled to as a result of the Supreme Court's 1985 ruling Ake v. Oklahoma.

McWilliams was convicted of murder during the robbery and rape in the death of Patricia Reynolds, who died in surgery later that day in 1984. A doctor conducted neuropsychological testing on McWilliams after it was requested by his defense team, but the doctor's report arrived at the court one day before the sentencing hearing. The defense was not granted more time to review the report, and the court sentenced McWilliams to death by electrocution.

McWilliams fought the decision unsuccessfully, and the lower courts ruled that McWilliams' due process rights were not violated because McWilliams had received an assessment from a psychiatric expert.

"[W]hen McWilliams asked for the additional assistance to which he was constitutionally entitled at the sentencing hearing, the judge rebuffed his requests," Breyer wrote. "Since Alabama's provision of mental health assistance fell so dramatically short of what Ake requires, we must conclude that the Alabama court decision affirming McWilliams' conviction and sentence was 'contrary to, or involved in an unreasonable application of clearly established federal law.'"

The dissenting opinion from the Supreme Court's conservative bloc was authored by Justice Samuel Alito and joined by Chief Justice John Roberts and Justices Neil Gorsuch and Clarence Thomas.

"Ake did not clearly establish that a defendant is entitled to an expert who is a member of the defense team," Alito wrote in explaining why the high court should not have ruled in favor of the death row inmate. "Indeed, 'Ake appears to have been written so as to be deliberately ambiguous on this point, thus leaving the issue open for future consideration.' ... Accordingly, the proper disposition of this case is to affirm the judgment below."

Alito also blasted Breyer's opinion as one that used a "most unseemly maneuver" to avoid affirming the lower court decision.

"The Court declines to decide the question on which we granted review and thus leaves in place conflicting lower court decisions regarding the meaning of a 32-year-old precedent," Alito wrote. "That is bad enough. But to make matters worse, the Court achieves this unfortunate result by deciding a separate question on which we expressly declined review. And the Court decides that factbound question without giving Alabama a fair opportunity to brief the issue."

Alito said Breyer's opinion was "an inexcusable departure from sound practice" in rejecting the lower courts' rulings.