RICHMOND, Va. -- Virginia would be allowed to force condemned inmates to die in the electric chair under a bill the state Senate approved Monday as a response to the nationwide shortage of lethal-injection drugs.

Democratic Gov. Terry McAuliffe has not indicated whether he will sign the bill, which set off a passionate debate in the General Assembly. The bill won approval with a 22-17 vote in the Senate, meaning it doesn't appear to have enough support to survive a veto if it's spiked by McAuliffe.

Like many states, Virginia has struggled to obtain lethal-injection drugs in recent years because drug companies have protested their use in executions. The short supply of the drugs has forced several states to pass or consider laws to bring back other methods of executions, such as electrocution and firing squads.

Get Breaking News Delivered to Your Inbox

Supporters of the bill say death penalty foes are forcing the state's hand by making it more difficult to obtain lethal injections. But opponents say forcing inmates into the electric chair will actually undermine the state's death penalty by putting the constitutionality of the law at risk.

"If you press the green button you're going to be sending us into a hail storm of legal chaos," said Democratic Sen. Scott Surovell, a staunch capital punishment opponent. "When somebody is given the death penalty in this state, the state is simply charged with extinguishing a human life, not torturing someone brutally until they finally die."

Senate Democratic Leader Dick Saslaw countered that when offenders murder multiple people, they no longer deserve to be treated humanely.

"When you commit acts like that, you give you up your right to as far as I'm concerned to say well I want to die humanely," Saslaw said.

Virginia is one of at least eight states that allow electrocutions, but it currently gives inmates the choice of lethal injection or the electric chair. If they decline to make a decision, they receive the injection. The bill would allow the state to use the electric chair if lethal injection drugs are unavailable.

The last Virginia inmate to choose the electric chair was 42-year-old Robert Gleason Jr., who was executed in 2013 after strangling two of his fellow prisoners.

In 2014, Tennessee passed a similar law to the one approved in Virginia. Utah last year approved the use of firing squads for executions if drugs aren't available. And Oklahoma became the first state last year to approve nitrogen gas for executions if lethal injections become unavailable or is deemed unconstitutional.

None of the states have executed condemned inmates using those methods since the bills were passed.

Supporters of the Virginia bill had been using the impending execution of convicted murder Ricky Gray to make their case for the bill, noting that the state has said it doesn't have enough lethal injection drugs to put him to death. But a federal appeals court put Gray's execution on hold last month until the U.S. Supreme Court decides whether to intervene.

The Republican-dominated House approved the bill with a 62-33 vote last month. The measure faces a final vote in the House before going to McAuliffe because of a minor amendment approved by the Senate. It is expected to be sent to the governor this week.