An electric chair used in 1908 at Auburn Prison in New York, where William Kemmler was executed by electrocution in 1890. (Library of Congress)

To understand the gruesome history of the death penalty, it is essential to comprehend how badly inventor Thomas Edison wanted to zap his nemesis George Westinghouse.

Their rivalry was literally electric.

Westinghouse was a purveyor of alternating-current voltage — AC. Edison developed direct-current voltage — DC. A very loud, very long-haired Australian band would a century later insert a lightning bolt in the middle of those letters, calling itself AC/DC.

But back to the 1890s.

Edison and Westinghouse, each trying to win lucrative electricity contracts, were fighting over which current was safer. This was a crucial marketing detail given that the general public’s familiarity with electricity was limited to lightning bolts.

What happened next makes the cage match between Apple and Google seem like a game of gin rummy.

Just as the two inventors were battling, a dentist in Buffalo named Alfred Southwick heard about a drunk man dying instantly after touching a generator, according to “The Electric Chair: An Unnatural American History,” by Craig Brandon.

A commission in New York had been contemplating replacing hangings with electrocution. (A similar shift would take place a century later as states such as Arkansas, which carried out back-to-back executions Monday and then put another man to death Friday, adopted lethal injection as the preferred method of capital punishment.)

Southwick thought that executing prisoners with electricity would be more humane than messy hangings. He tested his theory by electrocuting stray animals around town.

 On Nov. 8, 1887, Southwick sent Edison a letter about his findings, asking how best to electrocute humans.

The Wizard of Menlo Park wrote back, saying he abhorred the idea and would “join heartily in an effort to abolish capital punishment,” according to Brandon’s book.

None Thomas A. Edison examines film in 1889. (AP Photo)

Southwick, apparently a very persistent dentist, wrote Edison again a month later. This time, Edison had a different answer.

“The most suitable apparatus for this purpose is that class of dynamo-electric machinery which employs intermittent currents,” Edison wrote. “The most effective of these are known as ‘alternating machines’ manufactured principally in this country by Geo. Westinghouse.”

Edison’s logic was twisted, barbaric and possibly brilliant: If he could convince the world that Westinghouse’s alternating current was a swift and efficient killer, his method would be seen as safer, increasing his market share.

“The electric chair’s midwife was greed,” Brandon wrote, “the kind of pure, unadulterated greed for which the Gilded Age was famous.”

This episode led to New York adopting the electric chair as its tool of death. Edison made sure that Westinghouse’s alternating current was chosen by secretly funding another electricity engineer to quickly build the device.

The first victim: William Kemmler, a drunk who killed his common-law wife with a hatchet. Westinghouse hired Kemmler the best attorney he could find, even taking the case to the Supreme Court, which declined to overturn his death sentence.

On August 6, 1890, before the sun rose, Kemmler woke up in his cell, put on a suit and laced up a pair of polished shoes. The warden led him to a crowded room where an empty oak chair awaited him.

“Gentlemen, I wish everyone all the good luck in the world,” Kemmler said, according to newspaper accounts. “I believe I am going to a good place. The papers have been saying a lot of stuff that ain’t so. That’s all I have to say.”

The warden strapped Kemmler in, attaching electrodes to his head.

“Goodbye, William,” he said.

Then he motioned for someone to flip the switch.

“His shoulders slowly drew up as they sometimes do in the case of a man who is hanging,” a coroner later wrote.

Seventeen seconds later, two physicians determined that Kemmler was dead. The current was turned off. The room was silent.

And then someone yelled, “Great God, he is alive!”

Kemmler was breathing. His heart was beating.

“Turn on the current!” someone else shouted.

Four minutes later, Kemmler was really dead. His body took several hours to cool off. Newspapers called him the “poor wretch.”

Westinghouse was horrified.

“They could have done a better job with an ax,” he told reporters, according to several books on the death penalty.

Edison was more optimistic.

The excitement, he said, caused “some bungling.”

“I think when the next man is placed in the chair to suffer the death penalty,” he said, “that death will be accomplished instantly.”

Edison also offered some advice.

“The better way is to place the hands in jars of water,” he said. “And let the current be turned on there.”

More on Retropolis:

Before Ivanka Trump, other presidential daughters also wielded influence at the White House

Gen. George Patton’s wife put a Hawaiian curse on his ex-mistress. She was dead within days.

Hitler’s mother was “the only person he ever genuinely loved.’ Cancer killed her decades before he became a monster. 

Virginia Tech was not the worst school massacre in U.S. history. This was. 

The fake news that haunted George Washington

‘Assassins!’ A Confederate spy was accused of helping kill Abraham Lincoln. Then he vanished.

Hunting down runaway slaves: The cruel ads of Andrew Jackson and ‘the master class’