The 6-3 ruling is confined to mentally retarded defendants convicted of murder and does not address the constitutionality of capital punishment in general.
The majority's view reflects changes in public attitudes on the issue since the court declared such executions constitutional in 1989. Then, only two states that used capital punishment outlawed the practice for the retarded. Now, 18 states prohibit it.
"It is not so much the number of these states that is significant, but the consistency of the direction of the change," Justice John Paul Stevens wrote for the majority.
Chief Justice William H. Rehnquist and Justices Antonin Scalia and Clarence Thomas dissented. The three, the court's most conservative members, telegraphed their views earlier this month, when they complained bitterly about reprieves the court majority had granted to two Texas inmates who claim they are retarded.
The court ruled in favor of a Virginia inmate, Daryl Renard Atkins, who was convicted of shooting an Air Force enlisted man for beer money in 1996. Atkins' lawyers say he has an IQ of 59 and has never lived on his own or held a job.
The most immediate effect of the ruling will be in the 20 states that allowed execution of the retarded up to now. Presumably, dozens or perhaps hundreds of inmates in those states will now argue that they are retarded, and that their sentences should be converted to life in prison.
In the future, the ruling will mean that people arrested for a killing will not face a potential death sentence if they can show they are retarded, generally defined as having an IQ of 70 or lower.
The dissenting justices said the majority went too far in looking at factors beyond the state laws.
The majority puts too much stock in opinion polls and the views of national and international observers, Rehnquist wrote.
"Believing this view to be seriously mistaken, I dissent," Rehnquist said. Rehnquist omitted the customary word "respectfully" before "dissent."
The case turned on the 8th Amendment's protection against "cruel and unusual punishments," and how to define those terms today.
Times change, and with them public sentiment about what is appropriate punishment for various crimes, the court has observed in the past. For example, at various times in the country's history it was considered acceptable to flog people in public, or to execute those convicted of rape.
Using elected legislatures as a barometer, the court majority concluded that the public no longer accepts the notion that execution is appropriate for a killer who may lack the intelligence to fully understand his crime.
"The practice ... has become unusual, and it is fair to say that a national consensus has developed against it," Stevens wrote for himself and Justices Sandra Day O'Connor, Anthony M. Kennedy, David H. Souter, Ruth Bader Ginsburg and Stephen Breyer.
"This consensus unquestionably reflects widespread judgment about the relative culpability of mentally retarded offenders, and the relationship between mental retardation and the penological purposes served by the death penalty," Stevens wrote.
Many mentally retarded defendants know right from wrong, but they are more likely to act on impulse or to be swayed by others in a group, Stevens wrote.
"Their deficiencies do not warrant an exemption from criminal sanctions, but they do diminish their personal culpability."
Counting the 12 states that do not allow capital punishment at all, 30 states prohibit execution of the retarded.
The number of states that banned the practice increased ninefold between the court's last ruling on the issue and the time it heard arguments in Atkins' case. The court was forced to toss out a North Carolina case it originally selected to reconsider the retardation question last year, because that state banned the practice before the court could hear the case.
Virginia authorities argued that Atkins planned his crime and understood afterward what he had done. The state claimed he was no less culpable for the crime than a person of normal intelligence.
Atkins had 20 previous felonies on his record at the time of the killing, the state argued. Atkins gave a detailed confession to police when he was arrested, describing how he and an accomplice kidnapped the victim, forced him to withdraw cash from a bank teller machine and then drove him to a deserted field and shot him eight times.
O'Connor wrote the 5-4 decision in 1989 upholding execution of the retarded.
There was "insufficient evidence of a national consensus" against the executions to determine that they were unconstitutionally cruel and unusual, she wrote then.
President Bush has said he opposes executing the mentally retarded. Bush's successor as governor of Texas vetoed a ban on the practice.
The case is Atkins v. Virginia, 01-8452.