Dueling ads on gun rights by the National Rifle Association and a group backed by New York City Mayor Michael R. Bloomberg have joined the onslaught of campaign advertising in Virginia’s elections this year.

Two new ads this week from the NRA’s Political Victory Fund PAC have targeted the Democrats’ candidate for attorney general, Sen. Mark R. Herring (D-Loudoun) in his race against Sen. Mark D. Obenshain (R-Harrisonburg). The NRA ads link Herring to gun control, higher taxes and — Bloomberg.

“Mark Herring supports more gun control and will tax your freedom away,” one of the spots says. “Mark Obenshain defends your freedom and your safety.” Says another: “Herring will back Bloomberg’s big government agenda: gun control, gun rationing, a ban on the most popular rifle in America” — an apparent reference to the semiautomatic AR-15. Both ads tout Obenshain’s endorsements from several law enforcement groups and his backing from the NRA.

“It’s no wonder that fringe groups like the NRA are doing everything they can to help tea party candidate Mark Obenshain, because he agrees with them and votes with them,” Herring campaign spokesman Matt Wojtkun said in an e-mail. “Virginians are rejecting this extreme Cuccinelli-Obenshain ticket because it’s wrong for Virginia.”

Meanwhile, Bloomberg’s Independence USA super PAC sponsored an ad attacking Cuccinelli’s record on firearms, including his opposition to closing “the gun show loophole.”

“The gun show loophole — it means anyone can buy a gun without a background check: the dangerously mentally ill, criminals — endangering our families,” the ad says. Pictures flash of mass killers, including Adam Lanza, who killed 26 people at Sandy Hook Elementary School in Newtown, Conn., last December and Virginia-Tech shooter Seung Hui Cho. The ad says Cuccinelli is “too extreme for Virginia.”

Cuccinelli’s campaign said McAuliffe was out of step with Virginia’s view of gun rights.

“Terry McAuliffe ought to be ashamed of himself for trotting out radical billionaires from New York City and San Francisco who want to impose their liberal agenda on Virginia,” Cuccinelli campaign spokeswoman Anna Nix said, referring to Bloomberg and environmentalist billionaire Tom Steyer. “McAuliffe may be pandering to his base by locking arms with individuals who care nothing about our jobs or our constitutional right to defend ourselves, but their big government schemes are wrong for Virginia.”

Guns have been overshadowed in this year’s contest by negative attacks by the top major-party candidates on each other’s ethics and other issues.

“We are not surprised at all that the NRA has come into Virginia at the 11th hour,” said Lori Haas, state director for the Coalition to Stop Gun Violence, according to a recorded teleconference Tuesday. Haas, whose daughter was injured in the 2007 Virginia Tech shooting, called Obenshain a “lapdog for the NRA” for voting to repeal the limit on buying no more than one handgun a month and to allow people to carry weapons in establishments that serve alcohol.

Mary Croft, a retired elementary school teacher who helped organize the Blue Ridge Coalition to Stop Gun Violence, said Obenshain would be a copy of Cuccinelli, who she said had supported allowing applicants to take a multiple choice test online to qualify for a permit to carry a concealed handgun.

But members of Cuccinelli’s and Obenshain’s staff also pointed out 2009 legislative records from the General Assembly showing that several Democrats voted to override former governor Timothy M. Kaine’s veto of a bill that permitted the online tests, including Sens. Herring and Ralph Northam (Norfolk), who is the Democratic nominee for lieutenant governor.

An NRA ad links Sen. Mark R. Herring (D-Loudoun) to Sen. Mark R. Herring (D-Loudoun). (NRA)

Politico, citing sources that track campaign ads, reported that Bloomberg has agreed to kick in more than $1 million in ads for McAuliffe in the last two weeks of the race. Bloomberg’s entrance into the race led the Virginia Citizens Defense League to send out a call to arms to the gun-rights organization’s members:

“New York Mayor Michael Bloomberg wants to bring gun control to Virginia so badly he can taste it and has just given the Terry McAuliffe Campaign 1.1 million dollars for ads to do so,” according to an e-mail issued from President Philip Van Cleave. “This is a serious threat to gun owners in Virginia. McAuliffe begged Bloomberg for that money and I have no doubt that McAuliffe will repay Bloomberg out of gun-owner’s hides if he gets the opportunity to do so.”

The NRA has invested $500,000 in the Virginia governor’s race. The gun rights lobby has given “A’s” to Cuccinelli, Obenshain and GOP lieutenant governor nominee E.W. Jackson for their stance on gun rights; McAuliffe received an “F,” while Lt. Gov. nominee Sen. Ralph Northam (D-Norfolk) and Herring received “D’s”.