RICHMOND, Va. - A Virginia death-row inmate whose case led to the national ban on executing mentally retarded people will spend life in prison because prosecutors withheld evidence in his 1998 trial, the state Supreme Court ruled yesterday.

In a 5-2 decision, the justices upheld York County Circuit Judge Prentis Smiley Jr.'s order commuting Daryl Atkins' sentence to life without parole.

Atkins spent a decade on death row for the 1996 robbery and slaying of Eric Nesbitt, 21, an Air Force mechanic. Nesbitt was abducted outside a convenience store, forced to withdraw money from an ATM, and driven to a desolate road, where he was shot eight times. A codefendant, now serving a life sentence, testified that Atkins, then 18, was the triggerman.

Defense attorneys argued that Atkins should not be executed because he was mentally retarded. The case went to the U.S. Supreme Court, which ruled in Atkins v. Virginia (2002) that executing mentally retarded offenders is unconstitutional.

A new jury later decided that Atkins was not retarded and reimposed the death sentence, but the state Supreme Court ordered another hearing on Atkins' mental health. New evidence that he might not have been the triggerman - evidence not shared with the defense - became known at that hearing, prompting Smiley to commute the death sentence.

Prosecutors contended that the judge overstepped his authority because he was authorized only to conduct the hearing on Atkins' mental health.

The Supreme Court's majority disagreed, though Justice Cynthia Kinser wrote in a dissent that the judge should be ordered to conduct the mental-retardation hearing.

Atkins' attorney, John A. Gibney, said the decision was necessary to prevent a miscarriage of justice after the new evidence surfaced. Prosecutor Mark A. Krueger said he had not read the opinion and could not comment.