Democratic nominee Danica Roem is challenging Del. Robert G. Marshall (R-Prince William) in Northern Virginia’s 13th District. (J. Lawler Duggan/For The Washington Post)

The irony of Democrat Danica Roem’s long-shot campaign to oust a veteran conservative from Virginia’s House of Delegates is unmistakable.

Roem, 32, is a transgender ex-journalist with a passion for public policy details that rivals that of Del. Robert G. Marshall (R-Prince William), the scholarly conservative incumbent who has spent 25 years as a foil to the LGBT community.

Marshall, 73, sponsored Virginia’s constitutional amendment barring same-sex marriage — which stood until the U.S. Supreme Court declared such prohibitions unconstitutional — and this year proposed a “bathroom bill” that would have kept transgender individuals from using public restrooms designated for the sex with which they identify.

In a year in which Virginia Democrats hope to use an anti-Trump wave to cut into the GOP’s overwhelming majority in the state legislature, political analysts say Roem could succeed against Marshall where many other Democrats have failed. A victory over the ­13-term incumbent would make her the first openly transgender elected official in Virginia, advocates say.

But experts said the race, which is sure to attract national attention and a more-energized base on both sides, may also reveal that voters in the increasingly purple 13th District are not ready to be known for that historic distinction.

Del. Robert G. Marshal (R-Prince William) has held his seat in the General Assembly for more than 25 years. (BOB BROWN/AP)

Quentin Kidd, director of Christopher Newport University’s Wason Center for Public Policy, said Democratic voters may have drawn “too stark of a contrast” with Marshall by choosing Roem over three other candidates in Tuesday’s primary.

On the other hand, “it might be just what the Democrats need to knock Bob Marshall off,” Kidd said. “In other words, how deep is the pool of social conservatives in the 13th who aren’t already engaged?”

Both Roem and Marshall say they plan to campaign mostly on how to fix some of the increasingly densely populated district’s pressing problems, such as traffic congestion, school overcrowding and some sputtering business strips.

Roem says Marshall has done little to help ease backups along Route 28, a main thoroughfare that feeds into newer residential developments and strip malls in Manassas and Bristow, focusing instead on his conservative social agenda. She wants to convince the Northern Virginia Transportation Authority to allocate $300 million to widen a portion of Route 28 and get rid of some traffic lights.

Marshall argues that Roem doesn’t understand how to get funding for major road projects, noting that local governments need to request the changes before state lawmakers can act. He has been pushing regional transportation officials to make other road improvements along Route 28, including a proposal to add more lanes that is under review.

These and other policy differences may be overshadowed in the November election by what the two candidates will represent for their respective political bases, symbolism that likely will draw money for each campaign from outside the Washington area.

Aisha C. Moodie-Mills, president of the Victory Fund political action committee, said her organization plans to coordinate a massive fundraising effort on Roem’s behalf in hopes of opening the door for other lesbian, gay, bisexual and transgender candidates across the country.

““What we have seen ushered in is a vast degree of tolerance for bigotry, for hatefulness, frankly, since the November elections,” Moodie-Mills said. “And, this is an opportunity for us in the LGBTQ community to push back and say, ‘No, we’re going to stand up against bad actors; we’re going to make sure that we get rid of people who do our community harm.’ And, so Danica is really our first swing of the bat.”

Marshall, who won support from tea party activists when he sought the 2014 Republican nomination for the 10th District congressional seat now held by Rep. Barbara Comstock (R-Fairfax), is also likely to benefit financially.

In a statement after Roem’s victory Tuesday, Marshall pointedly referred to his Democratic opponent as “he,” underscoring his skepticism — and that of other social conservatives — regarding people who identify as transgender.

“My opponent and I differ on the proposed change in public school policy to allow males and females to use the lockers, showers, bathrooms and overnight hotel rooms of the opposite sex if they merely identify as ‘transgender’ which can change from day to day,” Marshall’s statement said. “He supports this change, and I do not.”

The longtime lawmaker emphasized his long record of constituent services and chastised some of Roem’s supporters for “name-calling,” an apparent reference to those who have referred to Marshall as “Bigot Bob.” He called on Roem to “reject this tactic.”

In an interview, Marshall declined to give details of his strategy for the general election campaign. “When I do campaign fliers, I will put a contrast between myself and my opponent,” he said. “I don’t get personal or whatever. So, we’ll just find out.”

Stephen J. Farnsworth, a ­political-science professor at the University of Mary Washington in Fredericksburg, predicted that money and support will come pouring into the race on both sides.

“Very few House of Delegates races will draw national attention, but this one will,” Farnsworth said. “It’s hard to imagine two candidates appealing more to two such different elements of the electorate. What’s going to happen here is both candidates will be exceedingly well funded.”

Roem won the nomination by capturing 43 percent of 4,237 Democratic primary votes, according to preliminary returns. She said she hopes to use the resulting name recognition to get more voters to listen to her ideas for easing traffic, bringing more jobs to the Innovation Technology Park in Manassas and incorporating sexual orientation and gender identity into school anti-discrimination policies.

Although she includes her own gender-identity story in her pitch to voters, Roem said, she also worries that the notoriety of the nomination could make her a target of hate.

“The threat of anti-transgender violence is really real,” she said. “This is not a joke. I know the risk I’m putting myself in.”