Image caption Dr William Petit, the only survivor of a home invasion that killed his family, fought to oppose the repeal

Legislators in the US state of Connecticut have voted to repeal the death penalty for all future cases, after a 10-hour floor debate.

Democratic Governor Dannel Malloy says he will sign the bill, making his state the 17th to end capital punishment.

As expected, state lawmakers voted 86 to 62 for the bill on Wednesday.

Two men sentenced to death in a recent grisly murder case - and the nine others on Connecticut's death row - will not have their sentences commuted.

Joshua Komisarjevsky and Stephen Hayes were convicted of the murder of Jennifer Hawke-Petit and her two daughters inside their Cheshire home in 2007.

Komisarjevsky and Hayes still have appeal rights, and it will probably be years before they are executed.

The murders shocked the US and helped defeat a previous bill to abolish the death penalty in Connecticut.

Dr William Petit, the only survivor of the home invasion attacks, fought to oppose the repeal.

But keeping Komisarjevsky and Hayes on death row created further support for the bill.

"For decades, we have not had a workable death penalty,'' Mr Malloy said in a statement.

"Going forward, we will have a system that allows us to put these people away for life, in living conditions none of us would want to experience."

Connecticut has only carried out one execution in 51 years, in 2005.

For all future cases, the highest penalty will be life imprisonment without parole. New Mexico passed a similar ban in 2009 and did not reduce the sentences of those previously sent to death row.

One legislator said the bill's limit to future crimes did not make sense, calling it a political tool.

"In terms of the bill we're about to vote on, we allow the death penalty to continue for at least 11 people and maybe more," Lawrence Cafero Jr, the Republican House Minority leader said.

Others who opposed the repeal outright described the details of the Petit murders and other cases that had led to a death sentence.

"I'm a man of faith and I won't tell you I haven't wrestled with my faith,'' said Democratic Representative Russ Morin during the debate. "But I'm going to be clear: I'm not torn on this matter, not one bit."

Captial punishment repeal proposals are pending in several other states including Kansas and Kentucky.