Gov. Bill Richardson signed legislation Wednesday repealing New Mexico's death penalty, making it the second state to ban executions since the U.S. Supreme Court reinstated the death penalty in 1976.

Richardson, a Democrat who formerly supported capital punishment, said signing the bill was the "most difficult decision" of his political life.

"Faced with the reality that our system for imposing the death penalty can never be perfect, my conscience compels me to replace the death penalty with a solution that keeps society safe," Richardson told a news conference in the state Capitol.

The state Senate passed the measure Friday by a 24-18 vote, and the House earlier approved it in a 40-28 vote.

The repeal takes effect July 1 and will apply to crimes committed after that date. Once in effect, the most severe punishment will be a sentence of life in prison without the possibility of parole.

With Richardson signing the measure, New Mexico joins 14 other states that do not impose capital punishment. New Jersey, in 2007, was the first and only other state to outlaw capital punishment since its reinstatement by the Supreme Court.

New Mexico has executed one person since 1960: child killer Terry Clark in 2001. Under the outgoing law, the death sentence could be applied in cases where children, law enforcement and correctional officials, and witnesses were murdered.

The sentences of two men currently on death row will not be affected by the new law.

The U.S. Conference of Catholic Bishops and former President Jimmy Carter were among those who urged Richardson to sign the bill.

The New Mexico Sheriffs' and Police Association opposed repealing the death penalty, saying capital punishment deters violence against police officers, jailers and prison guards. District attorneys also opposed the legislation, arguing that the death penalty was a useful prosecutorial tool.

Bernalillo County Sheriff Darren White said law enforcement officers have "lost a layer of protection and it's a sad day in New Mexico."

New Mexico was one of several states considering repealing the death penalty this year.

In Kansas, a bill failed to clear the Senate this week.