RICHMOND, Va. (Reuters) - The Virginia state Senate on Monday approved a bill making the electric chair the default method of execution if lethal injection drugs are unavailable.

The bill passed the Republican-controlled Senate by a 22-17 vote. The Republican-dominated House has already approved the measure.

After a lower chamber vote on a minor amendment, the measure will go to Democratic Governor Terry McAuliffe for approval. A spokesman for the governor said the measure would be reviewed when it arrived.

Virginia is one of eight states that allows electrocution as a method of execution, letting condemned inmates choose between it and lethal injection. If they do not choose, lethal injection is used.

Virginia, along with other states, has struggled to get lethal injection drugs because pharmaceutical companies have protested their use in executions.

The last death row inmate in Virginia to choose the electric chair for execution was in 2013.

Inmate Ricky Gray, who killed six people in Richmond in 2006, had been scheduled for execution on March 16, adding urgency to the legislative debate.

Gray’s execution has been postponed by the 4th U.S. Circuit Court of Appeals, pending a decision by the U.S. Supreme Court about whether to hear the case.

Gray has not indicated which method of execution he preferred.

The legislation has fueled debate in Virginia over whether capital punishment, especially the electric chair, constitutes cruel and unusual punishment.

“The electric chair is outdated and barbaric,” Senator Scott Surovell, a Democrat from northern Virginia, said during a floor debate.

He lost an effort to amend the bill by requiring the Virginia Department of Corrections to explain in detail why it was not able to obtain lethal drugs before opting for electrocution.

State Senator Mark Obenshain, a Republican from the Shenandoah Valley, argued that if the amendment passed it would have further delayed execution of death row inmates.

“Some (people) just have black hearts. They’re beyond redemption,” said Obenshain, an unsuccessful Republican candidate for state attorney general in 2013.