DID THE former chief of the FBI’s Washington field office pander to terrorist sympathizers? How about former members of Congress of both parties from Northern Virginia, or the current chairman of Virginia’s Republican Party?

Absurd, right? Yet that is the charge leveled by Virginia Republicans against the commonwealth’s attorney general, Mark R. Herring (D), for having done just what those other “panderers” did: visit a mosque.

In an online petition the other day dripping with hypocrisy and phony indignation, the state GOP did its best to whip up anti-Muslim bigotry by inciting party loyalists to protest Mr. Herring’s visit to a town hall at Dar Al-Hijrah mosque in Falls Church. “Tell Herring to apologize!” said the petition. “Stop Pandering to Terrorist Sympathizers.”

The email featured the attorney general’s photograph alongside those of Anwar al-Awlaki, an al- Qaeda-linked extremist who was the mosque’s head imam from 2001 to 2002; he subsequently left the country and was killed in Yemen by a U.S. drone strike in 2011.

Where to begin with the inanity of the Republican accusation? In January, the then-head of the FBI’s Washington field office, Paul Abbate, also visited the mosque, where he and other agents were introduced to the congregation by an imam after Friday prayer services and referred to as “friends.” Former U.S. representatives Tom Davis, a Republican whose congressional district included Falls Church, and James Moran, a Democrat from Virginia, both attended an event to mark the mosque’s 30th anniversary in 2013. Not a peep from the state GOP after any of those events.

Then there’s the current state GOP chairman, John Whitbeck, who visited a Northern Virginia mosque last year, albeit a different one, in Sterling, where he told congregants that the state GOP is “the party of religious liberty” and opposed President Trump’s campaign proposal to ban Muslims from entering the United States.

Naturally, it was fine for Mr. Whitbeck to visit a mosque, just as it is for Mr. Herring. But this is an election year in Virginia, and Mr. Herring is running to keep his job. Republicans seem to think that grants them license to wallow in prejudice, no matter how ridiculous the charges they level.

The problem is that emails such as the one denouncing Mr. Herring feed a wave of hatred washing over the nation, targeting Muslims, Jews and others who may strike some as different. The most recent FBI statistics, from 2015, show an increase in hate crimes generally with a sharp spike in anti-Muslim hate crimes; groups and scholars monitoring the problem believe that it has only gotten worse since then.

Cheap shots such as the one taken by Virginia Republicans will land only a glancing blow on Mr. Herring. At the same time, they will encourage and enable bigots and others inclined to violence.