In this Jan. 14, 2013 photo, then-New York Mayor Michael Bloomberg speaks at a gun violence summit at the Johns Hopkins Bloomberg School of Public Health in Baltimore. (Patrick Semansky/AP)

RICHMOND — Virginia Gov. Terry McAuliffe (D) suddenly knows what it’s like to be on the other end of a Michael Bloomberg advertising campaign.

Everytown for Gun Safety, a group bankrolled by the former New York mayor, poured $2 million into TV ads last fall in a failed bid to help McAuliffe’s party take back the state Senate.

On Wednesday, Everytown launched a social media campaign against McAuliffe, who last week stunned gun-safety advocates by announcing that he had struck a gun deal with Republican legislators and the National Rifle Association. It shows side-by-side photos of McAuliffe and the National Rifle Association’s Wayne LaPierre.

“What do VA Gov. Terry McAuliffe and NRA head Wayne LaPierre have in common?” one version reads. “Both Gov McAuliffe and NRA Head Wayne LaPierre support allowing dangerous people to carry hidden loaded weapons in Virginia.”

While clearly a lower-budget affair than last fall’s TV blitz, Everytown’s social media campaign against McAuliffe was a stunner, given how closely he worked with gun-safety groups since his 2013 campaign for governor. He narrowly won the race while bragging about his “F” rating from the NRA.

McAuliffe’s spokesman, Brian Coy, said the governor stands by the gun deal as a bipartisan breakthrough in an area where compromise has been hard to come by.

“While others talk or attack, Governor McAuliffe has taken action’’ to prevent gun violence, Coy said in an email. “This bipartisan compromise is the first meaningful gun safety legislation in Virginia in more than 20 years, and it will save lives by keeping guns out of the hands of domestic abusers and people who can’t pass background checks. This isn’t about national politics, it’s about making Virginia safer and that is what this agreement will do – plain and simple.”

The deal that the McAuliffe administration hammered out with GOP legislative leaders and the NRA caught gun-safety groups off guard. In December, Attorney General Mark R. Herring (D) had severed reciprocity rights of gun owners in 25 states with concealed-weapons standards looser than Virginia’s — a move that had infuriated gun-rights activists even though state law has long dictated that reciprocity be limited to states with standards on par with Virginia’s.

The McAuliffe deal, which still needs General Assembly approval, reversed Herring’s action — and then some, directing him to strike reciprocity deals with every state that offers them. In that sense, the deal expands gun rights.

But the deal also tightens restrictions in other areas. It would make it a felony under Virginia law for someone subject to a two-year protective order to possess a gun. Possession for such a person is already illegal under federal law. But because local police, not federal agents, respond to domestic incidents, abusers could be more likely to face charges. And because possession in such cases would be a felony, anyone convicted would lose the right to possess a firearm for life, barring subsequent restoration of civil rights through the governor.

The deal also calls for putting a state trooper at every gun show to run background checks for private sellers who currently have no way to check buyers’ criminal histories. But those checks would remain optional.

McAuliffe said the deal represents a compromise, which means neither side got all that it wanted. But all of the uproar seems to be coming from the left. As it released its social-media campaign, Everytown also announced that activists would go to the governor’s office Thursday to deliver a petition signed by more than 3,000 Virginians opposed to the deal.

McAuliffe talked up the deal Wednesday night on MSNBC’s Hardball with Chris Matthews, as the host asked him to comment on Hillary Clinton’s presidential campaign.

Matthews asked McAuliffe, a close friend of Clinton’s and chairman of her failed 2008 bid, how the former secretary of state’s strong gun-control rhetoric might play in a rural state like New Hampshire. McAuliffe answered by touting the “historic agreement” he had just struck on guns.

“If you can do it Virginia, which is the home of the NRA, working together, we can do this anywhere,” he said. “People want, folks, they want their legislators to come together, to work with their governors to make them safe.”