“My words cannot express how appalled I am that we have lost a critical tool to protect law enforcement and Nebraska families,” he said in a statement. “While the Legislature has lost touch with the citizens of Nebraska, I will continue to stand with Nebraskans and law enforcement on this important issue.”

In a debate that was by turns somber, fiery and soul-searching, with sprinklings of quotes from Ruth Bader Ginsburg, John Paul Stevens and the Book of Genesis, senators stood to make last-minute pitches to try to persuade the undecided. Some said that capital punishment should be retained as a tool to punish the most heinous crimes. Others said that the death penalty, which has not been used in Nebraska since 1997, was irretrievably broken.

“Today we are doing something that transcends me, that transcends this Legislature, that transcends this state,” said Senator Ernie Chambers, an independent from Omaha who sponsored the bill and has fought against the death penalty for decades. “We are talking about human dignity.”

A few senators argued that Nebraskans were still broadly in favor of capital punishment, even if many Republicans in the Legislature had turned away from it. Others said that they were deeply conflicted about their vote to retain the death penalty. “Today I will sustain the governor’s veto because I campaigned on it,” said Senator Tyson Larson, two hours into the debate. “This might be the last time I give the state the right to take a life, because I don’t think that they necessarily should.”

The bill replaces capital punishment with life imprisonment.

The vote on Wednesday came just a day after Mr. Ricketts signed a veto of the death penalty repeal bill in front of reporters assembled at the Capitol and talked about a gruesome bank robbery in the city of Norfolk in 2002 in which five people were shot to death as a compelling reason that Nebraska should hold on to capital punishment. Two family members of a woman who was shot during the robbery stood at the governor’s side.

Some Nebraskans said in interviews this week that they agreed with the governor.

“I’m sure small-town, rural Nebraska communities are furious about the repeal,” said Chris Spargen, a project specialist in his mid-20s, as he rode his bike down a main thoroughfare in Ashland, 30 miles outside Omaha. “I guess I’m technically falling under that as well.”