Virginia Attorney General Mark R. Herring D), left, and his Republican challenger, John Adams. (Left: Reuters. Right: Bill O’Leary/The Washington Post)

The unprecedented flow of cash into the Virginia attorney general's race this fall is being fueled by a group that promotes conservative judges, organizations for and against gun control, and a billionaire whose 5-Hour Energy drink is facing multiple lawsuits from attorneys general in other states over allegedly deceptive advertising.

Incumbent Mark R. Herring (D) and Republican John Adams are virtually tied in fundraising in the final days before Tuesday’s election with about $9 million each, more than twice as much as was spent in the 2013 contest.

The money is paying for negative advertising in the politically polarized contest and, analysts say, illustrates the extent to which outside groups are trying to influence the only attorney general's race in the nation this year — ahead of 31 attorney general contests in other states in 2018.

Campaign donations “influence the officeholders’ choices whether they know it or not,” said Geoffrey Skelley of the University of Virginia’s Center for Politics. “Not every donation is a quid pro quo, but you are probably going to listen to those donors a little more when big issues come up.”

The Republican Attorneys General Association (RAGA) and the Democratic Attorneys General Association (DAGA) in past years have not donated to candidates in contests that feature an incumbent. This year, however, the Republican group abandoned that posture, and the Democratic group quickly followed suit.

The organizations became the top fundraisers for each campaign, funneling money given to them by individuals, businesses and advocacy groups. RAGA has donated $6.7 million to Adams this year, according to state and federal reports tracked by the nonpartisan Virginia Public Access Project; DAGA has given Herring $2.3 million, plus $400,000 in in-kind donations.

The change in the Republicans' donation policy came after several Democratic attorneys general, including Herring, began aggressively challenging President Trump's policies in court. Many Republican attorneys general, who had previously challenged Obama administration proposals, have filed legal briefs supporting Trump's positions.

“Party committees have a clear mission: Win races,” said Zack Roday, RAGA’s communications director. “RAGA decided earlier this year not to leave winnable races on the table.”

As if to demonstrate the ongoing policy battles, Herring announced Thursday that his office has joined California, Delaware, Maryland and New York in suing over the Trump administration's recent decision to expand the rights of employers to deny women insurance coverage for contraception. Adams had argued twice in lawsuits for the rights of employers to refuse to provide birth-control coverage based on the employers' religious beliefs.

Mark Rozell, the dean of George Mason University's Schar School of Policy and Government, said the attorney general's race — which has drawn far less interest from the public than Virginia's heated gubernatorial contest — may be on the radar screens of interest groups for reasons that go beyond specific policy disputes.

“The down-ticket races are of such consequence to these donors because the election winners are likely to be gubernatorial candidates in four years,” Rozell said.

The biggest single contributor to either attorney general candidate is the Judicial Crisis Network, perhaps best known for its efforts last year to block President Barack Obama's Supreme Court nominee, Merrick Garland. The group sent $2.35 million to RAGA in 2017, according to the association's report to the Internal Revenue Service. Second was the National Rifle Association, which gave RAGA $775,000. ETC Capital, an investment fund in Farmington Hills, Mich., whose founder owns 5-Hour Energy, donated $500,000 to RAGA.

The Democratic association has reported donors only from the first half of 2017 to the IRS. It will file its report from the second half in early 2018.

In the first six months of the year, DAGA’s biggest contributions were about $75,000 from the United Food and Commercial Workers union and just over $60,000 from T-Mobile.

Since June 30, DAGA communications director Lizzie Ulmer said, some of the top donors have been Planned Parenthood, the National Education Association and Citigroup.

One Commonwealth, Herring’s own leadership political action committee, gave $827,500 directly to Herring’s campaign, making it his second-biggest donor after DAGA. The next biggest is Everytown for Gun Safety, which gave $600,000 through the end of October. One of that group’s founders is former New York City mayor Michael Bloomberg.

The Judicial Crisis Network’s chief counsel and policy director, Carrie Severino, did not respond to a question about Adams but said RAGA has had “enormous positive impact on our public policy landscape by supporting attorneys general who fight for the rule of law and the constitutional principles that protect every American.”

The network poured more than $2 million into Michigan court elections in 2012 and an additional $2 million to groups involved in 2014 judicial elections, according to the nonpartisan Center for Responsive Politics.

The Fairfax-based NRA gave Adams a top rating and created an anti-Herring television ad that accused the Democrat of taking away "the rights of gun owners to protect themselves" — a reference to Herring's decision to stop recognizing out-of-state concealed-carry permits, later reversed by Gov. Terry McAuliffe (D).

ETC Capital, which gave the third-largest amount to RAGA, was founded by Manoj Bhargava. He also founded Innovation Ventures and Living Essentials, companies that sell 5-Hour Energy and came under Food and Drug Administration scrutiny after 13 deaths were linked to the supplement. In addition, five attorneys general have sued over alleged deceptive marketing practices for the product, charges that the companies deny.

A Washington state court judge earlier this year ruled largely in favor of the state attorney general and ordered the company to pay $4.3 million. Judges in Oregon and Indiana ruled in favor of the company. Cases are pending in Vermont and Hawaii.

Bhargava has given millions to candidates for state office and political groups since 2009, the nonpartisan Center for Public Integrity reported in 2015. Douglas Graham, former vetting adviser for political conflicts of interest at the Obama White House and now the managing director of a Washington risk advisory and corporate investigation firm, called such contributions "not your typical political donations."

When a firm under investigation donates to those seeking to become a state’s top prosecutor, even in other jurisdictions, Graham said, it “definitely erodes the public’s confidence that justice will prevail.”

ETC Capital, Living Essentials and Innovation Ventures did not respond to requests for comment.

Herring's direct donors include gun-control groups, labor unions, Planned Parenthood, educators and conservationists, according to filings compiled by the Virginia Public Access Project. Adams's donor list is full of attorneys, developers, manufacturers, and energy and financial services executives or employees.

Herring has about 13 times the number of donations under $100 than Adams has, raising a total of $350,109 from 13,435 small donors, compared with $63,013 from 1,030 small donors to Adams, VPAP reports show. About 29 percent of Adams’s donations over $100 come from Virginia-based people or groups; about 40 percent of Herring’s donations that size are from the commonwealth.

Campaigns are not required to report the names and locations of donors who give less than $100.

Anu Narayanswamy contributed to this report.