Virginia Attorney General Mark R. Herring D) talks with Orlando Campos at a Latino festival. (Katherine Frey/The Washington Post)

The Democratic and Republican candidates for Virginia attorney general are drawing record donations from partisan groups at either end of the political spectrum as they spar over issues from abortion to religious freedom to guns.

But prospective voters they encounter on the campaign trail seem all but unaware of the race.

At a recent Korean festival in Chantilly, Republican nominee John Adams — a strong conservative and President Trump supporter — had a pleasant exchange with Jennifer Kim, 57, a Fairfax County homemaker.

“I think I can vote for him, I don’t know him, I want to think about it,” Kim said later. “I’m interested in schools and parks. I’m not a Trump supporter — I usually vote Democratic.”

The next day, at a Manassas Latino festival, incumbent Mark R. Herring (D) ran into Raffaele Ricciardelli, a recently naturalized U.S. citizen who admired the 2016 presidential run of Sen. Bernie Sanders (I-Vt.).

“I’m still looking and thinking,” Ricciardelli said after speaking with Herring. “I will compare the two people running. The most important issue is the health-care system . . . and I see a lack of infrastructure here, especially the train schedule in Manassas is ridiculous.”

Virginia Attorney General Mark R. Herring D), center, talks with new U.S. citizen Raffaele Ricciardelli, left, who will vote in a U.S. election for the first time on Nov. 7. At right is Ricciardelli's wife, Claudio Calderon. (Katherine Frey/The Washington Post)

The contest between Herring and Adams is the only attorney general’s race in the nation this November. It is unfolding in a state that has seen pitched battles in recent years over same-sex marriage, gun rights, the status of undocumented immigrants and Trump’s travel ban that targeted those from majority-Muslim countries.

Herring used his first term in office to champion liberal stances on those issues, suing the Trump administration over immigration issues and the travel ban, refusing to defend Virginia’s prohibition on same-sex marriage in 2014 and attempting — unsuccessfully — to bar people with out-of-state concealed-carry gun permits from carrying concealed weapons in Virginia.

Adams has challenged Herring’s activism, accusing the Democrat of acting too politically while in office, the same criticism that Herring lobbed against his Republican predecessor four years ago.

Recent polls show Herring with a narrow but consistent lead over Adams, with many voters still undecided.

Both candidates are on track to top 2013's record-breaking amount of campaign contributions, and both have begun running negative television ads.

With their second and final debate scheduled for Oct. 20, analysts say the race is likely to be decided close to Election Day and will hinge, at least in part, on whom voters support at the top of the ticket.

“These down-ticket races in gubernatorial election years tend to get very little voter attention,” said Mark Rozell, dean of George Mason University’s Schar School of Policy and Government. “Whichever gubernatorial candidate wins, depending on the margin of victory, most likely carries the down-ticket candidates with him to office.”

John Adams, top left, meets prospective voters on Sept. 23 at the 15th annual KORUS Festival in Chantilly. (Jahi Chikwendiu/The Washington Post)

At the Korean festival, Adams made a beeline for police officers and anyone wearing military caps or T-shirts, reminding them of his past work as a federal prosecutor and Navy officer.

Herring saw several people at the Manassas event who said they remembered him from his days as a supervisor and state senator in neighboring Loudoun County.

But the candidates reach far more prospective voters through attack ads on television and online. One, from Adams, criticizes Herring’s support of in-state college tuition for undocumented immigrants.

Another, from Herring, blasts Adams’s work defending corporate and bank clients accused of money laundering and fraud.

The National Rifle Association has weighed in with its own take on the race, giving Herring an "F" grade and Adams an "A."

The office of attorney general, the third-highest in state government, was once considered little more than a staging ground for a gubernatorial run. It has become both more partisan and more powerful in recent years, as the nation’s political landscape grew more fractious.

Attorney General Ken Cuccinelli (R), who served from 2010 to 2014, challenged the constitutionality of President Barack Obama’s Affordable Care Act, tightened enforcement of immigration law and prevented colleges from including sexual orientation in their nondiscrimination policies.

As a candidate in 2013, Herring decried that activism and vowed to "take the politics out of the office."

But Bob Holsworth, a former Virginia Commonwealth University professor and longtime observer of state politics, says both Herring and Cuccinelli used their positions “to aggressively promote their values.”

The national associations of Republican and Democratic attorneys general, which in the past stayed out of races where there was an incumbent, have abandoned that posture.

The Republican group had given $1.15 million to Adams as of Sept. 28 and was his largest single donor.

The Democratic group has contributed over $1.5 million to Herring, again more than anyone else. Herring has raised $4.6 million and had $2.9 million on hand as of Aug. 31. Adams, in the same period, had raised $1.8 million and had $598,000 on hand.

Attorney General Mark R. Herring poses for photos with campaign workers at a Latino festival in Manassas. (Katherine Frey/The Washington Post)

Herring, 56, won office in 2013 by 165 votes out of about 207,000 cast.

Twelve days into his term, he refused to defend Virginia’s same-sex marriage ban and entered the case on behalf of the challengers. Their victory at the U.S. Supreme Court helped end similar bans across the country.

“My decision was informed by our unique history on civil rights,” Herring said, citing the commonwealth’s past stances — all eventually overturned by the high court — on school segregation, interracial marriage and gender discrimination at the Virginia Military Institute. “We should not let injustices of the past be repeated again.”

Adams, 43 — a first-time candidate who is a partner at the Richmond-based law firm McGuire Woods, clerked for Supreme Court Justice Clarence Thomas and served as associate White House counsel under President George W. Bush — said Herring’s actions in the marriage case infuriated him.

“He literally got on the other side of the case from his client,” said the Republican, who cites his Baptist faith in explaining his personal opposition to same-sex marriage but says those beliefs would not affect his legal decisions as attorney general.

The ban, he said, “was the law in Virginia. His job as attorney general was to defend that law.”

John Adams, left, is the Republican candidate for state attorney general in Virginia. (Jahi Chikwendiu/The Washington Post)

Herring, whose actions as attorney general include protecting women's health clinics that offer abortions and addressing a backlog of untested rape kits, paints Adams as a "more extreme culture warrior" than Cuccinelli.

The Democrat called his opponent “100 percent anti-choice,” citing Adams’s work representing clients who objected to requirements that employers provide and pay for contraception for their employees.

Adams was the lawyer for 15 members of Congress in the Hobby Lobby case before the U.S. Supreme Court and for a number of law professors in a similar case by the Little Sisters of the Poor.

“I was there to protect the religious liberties of Catholic nuns,” Adams said in response to Herring’s criticism. “I have zero, zero, interest in limiting women’s access to birth control.”

The candidates also separate on the issue of gun rights. Herring supports uniform background checks and wants to limit individuals to buying one gun per month, a law that was in effect in Virginia for 20 years but repealed in 2012.

Adams said that people with criminal records or a history of mental illness should not be easily able to buy a gun, but he calls the one-gun-per-month rule an “unconstitutional infringement on Second Amendment rights.” At the same time, he said that if he is elected and the General Assembly were to pass such a law, he would defend it in court.

Herring’s years in office have given him statewide exposure, as well as multiple headlines that could either endear him to voters or send them to support his opponent.

Adams, meanwhile, could benefit from what Holsworth described as a natural advantage for Republican attorney general candidates among voters who consider the GOP the party of law and order.

As a purple state in a nonpresidential year, however, the deciding factor will probably be which gubernatorial candidate motivates his base more effectively, analysts said, and whether voters are drawn to the polls by a desire to embrace or repudiate Trump.

“So much depends on turnout,” Holsworth said. “Adams will run well in places that Republicans normally run well. But the big question is, will he face an overwhelmingly negative vote in Northern Virginia?”