Virginia attorney general candidates Mark Herring (D), left, and Mark Obenshain (R) debate at an event hosted by the Loudoun County Chamber of Commerce on Wednesday. (Jahi Chikwendiu/The Washington Post)

Virginia’s attorney general candidates debated each other at a Loudoun County forum Wednesday and often defined themselves in comparison with a third person who was not on stage: Ken Cuccinelli II, the current attorney general and Republican candidate for governor.

State Sens. Mark R. Herring (D-Loudoun) and Mark D. Obenshain (R-Harrisonburg) engaged in a spirited but mostly courtly debate hosted by the Loudoun County Chamber of Commerce that highlighted their different approaches toward defending the commonwealth’s laws against federal encroachment and other legal challenges.

Herring made it clear that he would represent a break with the legacy of activism created by Cuccinelli, who gained national stature by filing legal challenges to President Obama’s health-care law and regulations imposed by the U.S. Environmental Protection Agency.

“Time and again he has bent and twisted the law, and misused and abused the power of the office in order to advance personal ambition and an extreme ideological agenda,” Herring said of Cuccinelli. “Senator Obenshain would be a continuation of what we’ve got. He himself has said he and Ken Cuccinelli are peas in a pod, philosophically.”

Herring also expressed his support for expanding Medicaid coverage in Virginia as part of the implementation of the Affordable Care Act, also known as Obamacare. And he suggested that as attorney general, he would not fight its implementation.

At a debate in Norfolk on Wednesday night, Republican lieutenant governor candidate E.W. Jackson broke with Virginia’s socially conservative governor, Robert F. McDonnell (R), and argued that the commonwealth should not give equal treatment to the marriages of gay members of Virginia’s National Guard.

In August, the Pentagon issued a memorandum saying that it is now Defense Department policy “to treat all married military personnel equally.” A conservative state delegate subsequently called on McDonnell to withhold health and other benefits for the couples, but the governor said he would follow Pentagon policy.

Jackson pointed to Virginia’s passage, in 2006, of a constitutional amendment banning gay marriage.

“The people of Virginia have spoken,” Jackson said, adding that their views should be respected. “We ought not to be called bigots and haters because we do.”

Sen. Ralph S. Northam (Norfolk), Jackson’s Democratic rival, said he supports the marriage benefits for gay guard members. “It goes back to being fair with those who have served our country,” he said. Citing his own military service as a doctor during the Persian Gulf War, Northam added: “You don’t ask people what their sexual orientation is when they need help.”

Northam also assailed Jackson for previously stating that gay people’s “minds are perverted.”

The candidates for lieutenant governor also sparred over state rules on vaccinating girls to prevent the spread of HPV, the human papillomavirus, which causes cervical cancer. Starting in 2008, Virginia required girls to begin a three-dose course of the vaccine before starting sixth grade. The rules allow a parent to decline if they want.

Northam praised the current rules and said boys should get vaccinated, too. Jackson said he opposes mandates and that the goal of state policy should be “educating and persuading people, not telling parents we the state know what’s best.”

Northam argued that the requirement is essential for making sure the vaccinations are paid for. “If he takes the mandate away, it’s not going to be covered by people’s insurance. That’s the problem,” Northam said of his opponent after the debate.

Jackson would not address the insurance issue and instead repeated his opposition to mandates.

At the Loudoun forum, Obenshain promised that he would not shy from defending laws passed by the General Assembly or fighting the federal government when it pushes the limits of its power.

Obenshain endorsed Cuccinelli for teaming up with Fairfax County’s Board of Supervisors to fend off EPA regulations on stormwater runoff that would have cost Fairfax at least $150 million — a fight that Herring said he supported, too. Obenshain said he would also challenge the EPA’s recently proposed carbon emission limits that, according to energy industry officials, would effectively prohibit the construction of new coal-fired power plants. Obenshain said those regulations could “kill an entire sector of our economy.”

“It’s not just a handful of coal miners. It’s our railroads. It’s our ports. It’s manufacturing. It’s our data centers. It’s people living on a fixed income,” Obenshain said. “We’ve got to stand up and push back when the federal government steps over the line. And I will do that.”

Obenshain also expressed his opposition to expanding Medicaid coverage until serious changes are made to the system of state and federally subsidized health care for low-income people and others.

Both men were eager to paint themselves as pro-business at the forum, which touched on tort reform, judicial appointments and holding down tolls on the Dulles Greenway. The candidates shared similar views on ensuring that the attorney general’s office would continue efforts to crack down on human trafficking. They called for tougher regulations on ethics in light of the gifts scandal that has tarnished McDonnell’s tenure, although Herring accused Obenshain of being slower to speak out.

Herring went on the attack from his opening statement. He blasted the entire GOP ticket — Cuccinelli, Obenshain and lieutenant governor nominee E.W. Jackson — as extreme.

“In a Cuccinelli-Jackson-Obenshain Virginia, politicians in Richmond will dictate what women can or can’t do with their own bodies,” Herring said. He also tied Obenshain to the tea party, which Herring blamed for the Capitol Hill showdown over the Affordable Care Act that has caused the federal government to shut down. He also linked Obenshain to Cuccinelli as a co-sponsor on “personhood” legislation, which says life begins at conception, and other anti-abortion measures.

But Obenshain accused Herring of focusing on social issues while Obenshain was interested in public safety and ensuring that Virginia maintains its business-friendly climate.

“I understand that regulations are the number-one job killer in America,” Obenshain said. “And that when the federal government reaches over the line, like it did in Fairfax County on the stormwater regs, that we’ve got an attorney general who has the guts and determination to stand up and push back when the appropriate circumstances exist.”

Obenshain also said he disagreed with Cuccinelli’s position that the attorney general will not defend the law passed by the General Assembly allowing the state to take over failing schools; Cuccinelli says the law violates the state Constitution. But Obenshain said he would support it against a legal challenge and accused Herring of waffling on whether he would do the same.

Tony Howard, president and chief executive of the Loudoun Chamber, said he was pleased that the candidates, despite taking a few sharp jabs at each other, mostly focused on substance — in noticeable difference to the Fairfax County Chamber of Commerce debate last week between Cuccinelli and his Democratic opponent, Terry McAuliffe.

”I think they were both really articulate and eloquent. It really appeared to me the two candidates were taking a respectful but firm shot at their opponent, but then pivoting after 35 or 45 seconds into defining their positions on the issues,” Howard said of the attorney general candidates.