SAN QUENTIN — Had Michael Morales been executed as planned, his death would have taken place in a dimly lit room deep inside the fortress of San Quentin State Prison — a long way from the crowds that once gathered to see frontier justice administered at the end of the hangman’s rope.

The method would have been different, too. In California, hanging was replaced years ago by the cutting-edge technology of the gas chamber, which in turn was replaced by the more modern lethal injection now being challenged by Morales’ lawyers as cruel and unusual punishment.

The transformation reflects a decades-long attempt to grapple with how, when and whether to inflict the ultimate punishment on society’s worst offenders.

“It’s just an unsolvable kind of problem,” said Richard Dieter of the Washington, D.C.-based Death Penalty Information Center. “We’re never going to have a carefree system of painless executions.”

In the most recent case, Morales, 46, had been sentenced to die last week for killing 17-year-old Terri Winchell 25 years ago by attacking her with a hammer, stabbing her, raping her and leaving her to die half-naked in a vineyard.

But state officials indefinitely postponed the execution after conceding they could not meet the demands of a federal judge who ordered licensed medical personnel to participate in the execution and ensure the condemned does not feel pain.

The postponement left Winchell’s family angry and disappointed. “We just want to get this out of our heads and out of our lives,” said her mother.

The issue now goes to the courts in what could be a far-reaching decision, since 37 of the 38 states with capital punishment use a system similar to California’s.

Having someone stand over Morales’ deathbed, possibly injecting a fatal dose, would have been a first for California. It also illustrates society’s unease with bringing executioners into intimate contact with the condemned after years of striving to keep a wall between them.

Rough-and-tumble justice was the rule in Gold Rush California, but as early as 1872, the state’s penal code declared that executions should be carried out inside the walls or yard of a jail “or some convenient private place in the country.” Executions were moved to the state prisons in 1891.

That followed a national trend as officials became concerned that traditional town square hangings were becoming rowdy affairs, said Richard Moran, a professor at Mount Holyoke College and author of “The Executioner’s Current,” documenting the history of the electric chair.

Rather than give up capital punishment, “the compromise was: We will move it indoors where we will have more control over it,” Moran said.

So, the parade through town shrank to a short walk from a “death watch” cell to the execution room. Instead of the eating and drinking that accompanied some executions, there was the condemned man’s last meal.

Even in the early years, science was brought to bear with attempts to make sure hangings were swift by calculating rope lengths and using ropes that had been stretched to make sure they wouldn’t rebound.

At San Quentin, one of two state prisons where hangings took place, the condemned walked up 13 steps — one for each of the jurors and one for the judge. Three officers sitting at a table cut strings at a signal. Two strings did nothing; the third sprang the trapdoor.

The advent of the gas chamber in 1937 was hailed as a better way. It worked by the executioner pulling a lever from behind a wall that dropped bags of cyanide pellets into vats of acid, creating hydrocyanic gas.

Numerous inventions have been put forward in the effort to kill humanely — a rather incongruous concept. It was a French doctor, Joseph-Ignace Guillotin, who proposed the method of decapitation that became known as the guillotine.

The electric chair, first used in 1890 in New York state, was another scientific “breakthrough,” although to modern eyes shocking prisoners with up to 2,200 volts seems like a grisly method — flames leaped from the heads of two Florida inmates.

California switched to lethal injection in 1996 after a federal judge ruled that forcing criminals to gasp for air as they died from breathing cyanide was cruel and unusual punishment.

Unlike gas, where the condemned men heaved and strained to breathe, their eyes rolling back in convulsive death spasms, those killed by lethal injection are mostly still, although it can take a while to find a vein.

The last public execution in the United States took place in Owensboro, Ky., in 1936.

News reports described the scene as a carnival, with thousands of people attending, eating hot dogs and popcorn. Those reports were misleading, said Perry T. Ryan, who interviewed a number of surviving witnesses for his book, “The Last Public Execution In America.” Thousands did attend, but the crowd wasn’t unruly, said Ryan, an attorney who works in the Kentucky attorney general’s office.

True or not, the accounts stoked the move to conduct executions out of the public eye, something that’s not likely to change, death penalty experts said.

“I don’t think most people want it to be a big display again,” said Dieter. “People are just as happy not to see it.”

More in News

Intuitive Surgical paid $30.4 million in cash on March 5 for a more than three-decade-old building about two blocks from its current headquarters, which are on Kifer Road in Sunnyvale, according to Santa Clara County property records.

House Oversight and Government Reform Committee Chairman Elijah Cummings, D-Md., said in a letter sent Thursday to White House Counsel Pat Cipollone that the administration has failed to produce documents tied to Kushner and other officials despite requests from the committee since 2017.