Dan Helmer is one of six Democratic candidates competing in the June 12 primary for the nomination to run against GOP incumbent Barbara Comstock in Virginia’s 10th Congressional District. (Jahi Chikwendiu/The Washington Post)

The White House on Thursday denounced a campaign ad produced by a Democrat seeking the nomination to challenge Rep. Barbara Comstock (R-Va.) that compared President Trump to Osama bin Laden.

The ad flashes an image of bin Laden followed by one of the White House as the candidate, Army veteran Dan Helmer, says, “After 9/11, the greatest threat to our democracy lived in a cave; today he lives in the White House.”

Helmer uses the line in nearly every public appearance, but the 30-second spot, slated to air on broadcast television from Thursday until the June 12 primary, provoked a response from the Trump administration.

“The message sent in a campaign ad from a congressional candidate from Virginia is nothing short of reprehensible. Leaders from across the political spectrum — starting with Leader Pelosi — must swiftly condemn this abhorrent message,” White House spokesman Raj Shah said in a statement. He referred to House Minority Leader Nancy Pelosi (D-Calif.).

Helmer’s campaign responded by accusing Trump of failing to uphold his oath of office.

“With this ad, we have joined others such as Thomas Friedman and Republican Senator Jeff Flake, sounding the alarm about the threat to our democracy that President Trump poses,” his campaign manager, Bonnie Krenz, said in a statement.

Virginia’s sprawling 10th Congressional District includes all of Loudoun County and parts of Fairfax and Prince William counties, as well as all of Frederick and Clarke counties to the west.

Both parties consider it one of the most competitive seats in the country — the Cook Political Report characterizes it as a “toss-up” — because President Trump is unpopular with the suburban women who represent a significant voting bloc there. Hillary Clinton won the district by 10 percentage points, but Comstock outperformed Trump by 16 points and sailed to reelection in 2016.

A few hours before the White House weighed in, Comstock put out her own statement defending Trump, whom she has condemned for past behavior including the “Access Hollywood” video in which he bragged about groping women.

“[Helmer] has been saying this to the applause of his fellow Democrat candidates in order to get attention and major funding from extreme left-wing mega donors like Tom Steyer,” she said in a statement. “It’s an outrageous and offensive thing to say, and beyond the pale. In Congress, we have been standing with President Trump, on a bipartisan basis to strengthen our military, defeat ISIS and battle terrorism, and make the world safer.”

Helmer is one of four Democrats in the a six-candidate field with the resources to buy airtime in the expensive Washington media market, which includes the 10th District. He has called for Trump’s impeachment, a Medicare-for-all option and the legalization of marijuana. The others are state Sen. Jennifer Wexton, the apparent front-runner; strategist Lindsey Davis Stover; and Alison Friedman, an activist against human trafficking.

Helmer has also used unconventional — and cheaper — methods to gain attention, such as when he sang, “You’ve lost that centrist feeling” to a Comstock lookalike in a “Top Gun” spoof, which Slate termed the “Worst Ad of the 2018 Elections.” Recently, he went undercover to buy a semiautomatic rifle at a gun show without a background check.

Comstock also dinged Helmer for moving to the district with his wife and two sons in November 2013. Helmer said he was released from active duty in September 2014.

“Dan Helmer is new to the 10th District and has been trying to get attention with various stunts because his campaign is flailing and out of touch with regional issues and concerns,” Comstock said.

A Rhodes scholar and West Point graduate, Helmer still serves in the Army Reserve and previously worked as a strategic adviser at the Boston Consulting Group.