Virginia Gov. Terry McAuliffe leaves the chambers after delivering his annual State of the Commonwealth address before a joint session of the Virginia House of Delegates and Virginia Senate at the Capitol in Richmond on Jan. 14. (Steve Helber/AP)

State-sponsored executions in Virginia would become shrouded in unprecedented secrecy under legislation that is advancing with bipartisan support, including that of Democratic Gov. Terry McAuliffe.

The measure is intended to keep drugs used for lethal injections flowing into Virginia by shielding manufacturers from public scrutiny and political pressure.

Foreign companies have stopped selling such drugs as a result of pressure from their governments, leaving some states unable to carry out death sentences and prompting others to experiment with chemicals that have been blamed for several ­high-profile botched executions.

The legislation would prevent the public from scrutinizing most everything to do with the death penalty in Virginia. The bill states that “all information relating to the execution process” would be exempt from the state’s open ­records law. Although the names and quantities of chemicals used would have to be disclosed, the names of the companies that sell them and information about buildings and equipment used in the process would be withheld.

Adding a political twist to the situation, the bill’s chief booster is McAuliffe, a Democrat who opposes the death penalty but whose support makes passage more likely.

The measure would place Virginia in the vanguard of states trying to continue a practice that most of their residents still support but that has become increasingly difficult to administer, for both political and technical reasons. The proposal has been praised by people who say it would ensure that executions are carried out in the most humane way possible. But it is denounced by death penalty opponents, as botched executions have increased scrutiny across the country, including a Supreme Court review of lethal injections in Oklahoma.

The secrecy provisions, in particular, are a matter of disagreement. Lisa Kinney, a spokeswoman for the Department of Corrections, said the law would provide “security” by shielding drug providers from “harassment, threats or danger.” Foes contend that more scrutiny of state-sponsored executions, not less, is the way to prevent inhumane deaths.

“This bill is about them trying to hide challenges to them, not about their security,” said defense attorney Jonathan Sheldon, who has been involved in litigation over lethal injection. “We don’t need to know the name of who the [executioner] is. . . . What we really want to know is: ‘What is the procedure?’ They’re cloaking this in a false mask of security.”

Sen. Thomas A. Garrett Jr. (R-Buckingham) said the opponents raised a “legitimate concern” about secrecy. But he added, “I would say that it’s outweighed by us being able to carry out sentences that have been prescribed legally and throughout layer upon layer of due process.”

McAuliffe’s advisers have been surprised by the intensity of opposition, because they see the legislation as a way to avoid a return to the electric chair as the primary means of execution in a state where capital punishment remains the law.

McAuliffe spokesman Brian Coy said that although the governor does not support capital punishment, it is his responsibility to uphold the law. “He is a Catholic,” Coy said, “so there is a moral component to his position on the issue, but he’s governor, and he will enforce the law.”

Several other states have enacted laws in recent years to shield the details of executions from public scrutiny. An Ohio law similar to Virginia’s legislation was enacted late last year, but it is being challenged in federal court. Ohio has delayed all pending executions amid concerns about the drugs used.

In 2014, some lawmakers made an unsuccessful push in Virginia to reinstate the electric chair as the state’s default method of execution should the necessary drugs become unavailable. McAuliffe did not take a position on that measure.

In neighboring Maryland, then-Gov. Martin O’Malley (D) made abolition of the death penalty a cornerstone of his legislative agenda. The two states are far apart on this issue. Maryland has executed five prisoners since the Supreme Court ended an effective moratorium on the death penalty in 1976; Virginia has executed 110.

Noting all the current legal challenges to execution methods and secrecy, the Virginia Catholic Conference’s executive director, Jeff Caruso, said, “It seems like we should be slowing down instead of speeding up.”

The politics of the death penalty began to change in Virginia in 2005, when Timothy M. Kaine (D), a death-penalty opponent who had defended death-row inmates pro bono, was elected governor. Kaine’s Republican opponent, Jerry Kilgore, ran a TV ad saying that Kaine wouldn’t have supported executing Adolf Hitler. Kaine, a Catholic, responded with an ad declaring that his faith led him to oppose the death penalty but that he would uphold the state law.

“Kaine demonstrated that if you articulate your position in a thoughtful and consistent manner, then people will respect that position,” said J. Tucker Martin, Kilgore’s spokesman in that race and later an aide to then-Gov. Robert F. McDonnell (R). Still, Martin said, he believes that Virginia remains “a pretty tough-on-crime state.”

There were 11 executions on Kaine’s watch, despite his beliefs.

A 2013 University of Mary Washington poll found that 65 percent of Virginia adults believe that the state should “keep” the death penalty for first-degree murder.

“I continue to believe the majority of Virginians support the death penalty,” said Secretary of Public Safety Brian Moran, who testified in favor of this year’s lethal injection bill. “The death penalty exists in the commonwealth, and we’re merely trying to ensure that those sentenced to death are able to have the choice of lethal injection.”

When McAuliffe ran unsuccessfully for governor in 2009, according to news reports, he supported capital punishment. McAuliffe’s office said this week that his position has always been that he would not let his personal feelings on the issue keep him from performing his duties as governor.

The death penalty still has majority backing nationally as well, according to a 2014 Washington Post poll, although support is slowly falling. Among Democrats, however, a slim majority is opposed, and the same is true for non-white respondents. And if lethal injection is unavailable, overall support in the poll dips to 48 percent

Numbers of executions and death sentences have declined along with popular support in Virginia and nationally. There are currently eight inmates on death row in Virginia, fewer than in all but seven other states that practice capital punishment. Virginia, once second only to Texas in executions, has fallen behind Oklahoma and has executed fewer people than Florida every year since 2011.

Senate Minority Leader Richard L. Saslaw (D-Fairfax), who sponsored the bill on behalf of McAuliffe, suggested that death penalty opponents are hoping for a return to the electric chair to weaken support for capital punishment. Their argument, he said, was that “if you make the death penalty too humane . . . then people will think there’s nothing wrong with the death penalty.”

Del. Scott A. Surovell (D-Fairfax) said that he suspected that the Department of Corrections was seeking additional secrecy to prevent the kind of scrutiny that occurred last year.

Last year, soon after the department told lawmakers that it lacked a necessary lethal-injection drug, the Richmond Times-Dispatch reported that an alternative had been purchased and stockpiled. Then, the department announced that the new drug had been approved for use. But the drug, midazolam, was involved in prolonged executions under scrutiny by the Supreme Court.

The Department of Corrections “got egg on their face,” Surovell said. “They’re trying to make all these documents secret so they don’t get caught again.”

Even without the legislation, obtaining records related to executions is far from easy. Surovell is engaged in a legal battle with the Department of Corrections over its refusal to reveal lethal-injection protocols, citing security concerns. The state Supreme Court will hear that case.

Laura Vozzella contributed to this report.