Clearing its biggest hurdle, a bill repealing the death penalty passed the state Senate on a 20-16 vote shortly after 2 a.m. Thursday, with two Democrats and all 14 Republican voting against it.

The chances of repeal were so unlikely last year  that the bill wasn’t even raised for a vote after a strong lobbying effort by Dr. William A. Petit Jr., the lone survivor of a brutal 2007 triple-homicide at his Cheshire home.

Petit, his sister, and their lawyer were able to convince Sen. Edith Prague, D-Columbia, not to vote for repeal last year, but left Wednesday afternoon before they were able to speak with her and other Senators thought to be on a fence about the issue.

As the debate over the death penalty stretched into Thursday morning, prospects for its repeal looked promising as one lawmaker who had previously opposed repeal said she had changed her mind.

Sen. Gayle Slossberg decided to support repeal after some soul searching. She said she’d come to the conclusion that a moral society couldn’t execute people, because it risks becoming the evil it strives to eliminate.

Slossberg said she was disturbed by one of the early Republican presidential debates during which Texas Gov. Rick Perry was asked about the aggressive death penalty policy in his state.

“Before Gov. Perry even had a chance to answer, the crowd cheered,” she said. “What kind of society cheers death?”

Capital punishment appeals to the basest human instincts and degrades society, she said.

“If someone harmed my family I would want to harm them back, but I want my public policy to be better than me,” Slossberg concluded.

On Tuesday, Prague, who was previously undecided this year, said she would be voting for the bill. However, she made her support conditional, saying she had to be convinced that if the bill passed, the 11 men currently on death row would not have their sentences commuted. Early on in the debate, she questioned Sen. Eric Coleman, the bill’s proponent, on the intent of the bill and seemed content with Coleman’s answers.

Sen. Carlo Leone, D-Stamford, who voted against repeal when he was in the House, said that the amendment’s creation of a new classification for inmates convicted of capital murder contributed to his support of the bill this year.

“In essence, it’s life on death row,” he said. “. . . In the end that’s kind of what did it for me. Now there is a distinction, a harsher reality.”

Sen. Joseph Crisco, D-Woodbridge, who also had voted against repeal in 2009, said he spoke with the families of victims and learned the appeals process was just too painful. He also talked about his visit to death row at Northern Correctional in Somers.

Though most agreed that the bill would pass the chamber earlier in the day, Republicans filed 21 amendments, ensuring the debate would be lengthy.

Two hours into the debate, which started around 3:38 p.m. Wednesday, Democrats passed a key amendment to keep inmates convicted of capital murder in living conditions mirroring death row. The 21-14, party-line vote was a strong indication that the bill had enough support to clear the chamber signaling for the first time that Connecticut may become the 17th state in the nation to repeal the death penalty.

Much of the opposition to the repeal centered around the assertion that passage would result in the sentences of the men on death row being commuted. One amendment, proposed by Sen. Leonard Fasano, R-North Haven, would have reinstated the death penalty if a death row inmate successfully appealed his sentence after the bill passed.

Fasano argued that if lawmakers truly wanted the inmates on death row to be unaffected by the bill they should support his proposal. That amendment failed on a 20-15 vote.

Sen. Minority Leader John McKinney, R-Fairfield, lobbied Prague to change her vote Wednesday. Standing beside her in the Senate chamber, McKinney told her that appeals will be brought immediately on behalf of the 11 death row inmates.

“Understand that nothing we do or say about the intent of the legislature matters in that legal argument,” McKinney said earlier in the day, outlining his argument for Prague. “It will be based on what the constitutional rights are under the laws that we have and that is what our courts do.”

A recent Quinnipiac University poll  found most Connecticut voters support the death penalty.

Sixty-two percent of voters said abolishing the death penalty is a “bad idea,” but this year’s poll did not give voters a choice between life in prison without parole or death. The margin of those who oppose the death penalty increased in past polls when voters were given a choice. Abolitionists have criticized the poll for failing to pose the question.

With public opinion on their side, Republicans already were planning their campaign mailers as debate reached the six-hour mark. Sen. Rob Kane, R-Watertown, even reminded his colleagues that voters will remember this vote when they go to the polls in November.

Sen. John Kissel, a staunch death penalty supporter, led the opposition to the bill. He criticized the Democrats’ amendment to maintain death row-like living conditions for inmates convicted of heinous crimes.

The amendment’s goal was similar to one Kissel had proposed in the Judiciary Committee — it aims to provide a more severe punishment for inmates convicted of the worst crimes. But the Enfield Republican said the Democrats’ proposal contained a “glaring, giant escape hatch.”

He was referring to a provision of the amendment, which has the Correction Department commissioner conduct a security status assessment on the inmate after his or her conviction. The process gives inmates the opportunity to be reclassified depending on the security threat they pose.

Kissel said the amendment leaves too much up to the commissioner.

“My amendment said you’re convicted of these crimes, you get segregation — period,” he said.

Kissel suggested the 11 men currently on death row will have their sentences commuted and eventually end up in the general inmate population when they are no longer considered a security threat.

He also criticized provisions of the amendment he said Democrats had characterized as “get-tough” provisions. For instance, as amended the bill will require inmates to be transferred to a different cell every 90 days. Kissel said that didn’t seem like a punishment.

“I’m sitting in a cell doing life? Please move me around every 90 days!” he said.

Coleman said Kissel’s interpretation of the amendment was a gross misreading of the language. The provision requiring the inmates be moved was a security recommendation from the Correction Department, he said, one which inmates don’t like.

“Inmates want some sense of stability. They don’t want to be disrupted,” he said.

Coleman said that after the security assessment, the commissioner will either put inmates in the new death row-like housing or put them in administrative segregation, which is considered worse.

As for the inmates currently on death row, Coleman said the amendment would have no bearing on them, as they will remain on death row.

Nonetheless, after the amendment was adopted, Kissel raised his own amendment to take away the discretion of the commissioner and require the inmates automatically be put in holding similar to death row.

“They should go into special segregation and that’s it. That’s where they stay,” he said.

Coleman argued that Kissel’s amendment was likely unconstitutional because it didn’t give the Correction Department enough leeway and might be considered cruel and unusual punishment.

“I like my amendment just fine and I would urge members of the Senate to reject this one,” Coleman said.

They rejected Kissel’s amendment along party lines.

Sen. Andrew Roraback, R-Goshen, said he would vote against the bill after lawmakers rejected his amendment to limit the program passed last year that allows inmates to earn time off their sentences by participating in rehabilitative programs.

Roraback, an opponent of the death penalty, argued the program betrayed the trust of crime victims and their families who count upon the state to keep offenders imprisoned for a fixed duration.

Coleman said the program serves a valid purpose by encouraging inmates to participate in programming that helps address their problems and make it less likely they will commit more crimes. Forty-five other states have similar programs and most of them are more generous than Connecticut’s, he said. The amendment failed 20-15.

Victims’ families sat in the Senate gallery and watched the debate intently. Some have been fighting to abolish the death penalty for 30 years and many wanted to watch history being made.

Jane Caron of Thomaston, whose aunt was stabbed and left to die alone in 1986, was among them.

Caron, unlike Petit, is in favor of repeal. Following a press conference during which Petit expressed his support of keeping the death penalty Wednesday morning, Caron said she completely understands the emotion involved.

“There has to be justice but I can’t support murder,” Caron said.

Caron, who is a social worker, said everything we know about violence, makes more violence.

“Having the state of Connecticut commit violence is not going to be very effective,” Caron said. “I think they can have life without parole.”

“Justice for me has to apply to society,” Caron said. “I don’t think we can make life or death decisions on one or two cases.”

Betty Gallo, lobbyist for the Connecticut ACLU, called the passage of the bill an amazing victory.

“A lot of people worked really, really hard to make this happen for a long time,” she said.

Gallo said she found herself thinking about the night Michael Ross, the last person the state executed, was killed.

“I thought, ‘We’re all implicated in this. This is all of us, our government. We all killed this man. I think, hopefully, we’ll never do that again,” she said.

The bill will now go to the House of Representatives where it is expected to have broader support. Gov. Dannel P. Malloy has said he will sign the bill if it makes it to his desk.