Democratic primary candidate Danica Roem makes her pitch to voters at the Bull Run Swim & Raquet Club while debating three fellow Democrats vying to unseat Republican state Del. Robert G. Marshall in Manassas. (J. Lawler Duggan/For The Washington Post)

A Democrat who would be Virginia’s first openly transgender lawmaker won the primary contest to challenge Del. Robert G. Marshall (R-Prince William), a social conservative who proposed a “bathroom bill” and authored the state’s constitutional amendment banning same-sex marriage.

Danica Roem, a former Gainesville and Prince William Times reporter, beat three rivals Tuesday to join the largest slate of Democratic House candidates in recent memory, joining the launch of a general election campaign in which the party hopes to retake control of a legislative chamber that has a staggering Republican majority.

The Democrats — many of whom say they were inspired to run after the election of President Trump — will compete in 87 of the state’s 100 House districts in November, making for the largest number of contested races in at least 20 years.

Democrats had 19 competitive nomination contests, eight of them in districts that presidential nominee Hillary Clinton won last fall. In addition, nine Democrats were uncontested in their primary bids to challenge Republican incumbents in districts where Clinton triumphed.

All four Democratic incumbents who faced challenges Tuesday, including House Minority Leader David Toscano (D-Charlottesville), appeared to have coasted to victory.

Roem easily won her four-way race with about 1,500 votes out of about 3,000 cast, a turnout far lower than what can be expected in November.

Although the 13th District leans blue in federal contests, and went for Clinton by 14 points, Marshall has fended off a series of Democratic challengers in his 25 years in office.

Roem, 32, said she thinks she can succeed by capitalizing on the surge of Democratic energy and focusing sharply on transportation issues, especially congestion on Route 28, while tearing into Marshall for spending time on conservative causes.

“People are tired of the fact he is focused on discriminatory social policies instead of bread-and-butter, quality-of-life issues they face every day,” she said. “He is more concerned with where I go to the bathroom than where his constituents go to work. I’m running a race on improving transportation rather than ensuring discrimination.”

Marshall, in a statement in which he referred to Roem with male pronouns, said he has always been candid about his conservative views and would run a campaign focused on the issues.

On the Republican side, voters chose nominees in four competitive primaries to run in open seats. Those selected included outgoing House Speaker William J. Howell’s chosen successor, Stafford County Supervisor Robert Thomas. GOP voters stuck with two incumbents who faced primary challenges.

House races in off-year elections normally take a back seat to the heated statewide contests for governor, lieutenant governor and attorney general.

But this cycle has seen a surge of interest from Democrats, including a record number of female candidates. Several national progressive groups endorsed and trained Virginia candidates, following criticism that the national party had neglected local and state races, leading to significant losses in the last decade.

Republicans hold a 66-to-34 majority in Virginia’s House of Delegates. Democrats could regain control of the chamber for the first time since 2000 if they sweep all 17 House districts won by Clinton, a proposition that leaves little margin for error. The party is also eyeing opportunities to pick up seats in 2018 if a judge in a lawsuit challenging how district lines are drawn orders new elections.

“We are going to expose the Trump agenda and what it means for Virginia,” said Toscano, the Democratic leader who easily beat a challenge from the left by Ross Mittiga.

Republican party officials say they will welcome challenges to GOP incumbents in red-leaning districts during a governor’s race.

“These are fringe extreme candidates,” John Whitbeck, chairman of the Republican Party of Virginia, said of the Democrats who are running. “It helps the top of our ticket because [voters] are more likely to vote for the Republican nominee for governor if they are turned out by Republican incumbents.”

National progressive groups aligned with U.S. Sens. Bernie Sanders (I-Vt.) and Elizabeth Warren (D-Mass.) endorsed several House candidates, in addition to Democrat Tom Perriello, who lost the gubernatorial primary to Lt. Gov. Ralph Northam. They saw mixed results.

Elizabeth Guzman was the only one of three progressives backed by Sanders’s Our Revolution group to win a competitive primary. She narrowly defeated Sara Townsend, the Democratic nominee in 2015, in the race to challenge Del. L. Scott Lingamfelter (R), and would be the first Latina lawmaker in the state.

The only House primary too close to call was in the 2nd District, encompassing Prince William and Stafford counties, where Jennifer Foy led 2015 Democratic nominee Joshua King by 10 votes.

“2017 is a precursor to the dynamics in 2018” said Adam Green, co-founder of the Warren-aligned Progressive Campaign Change Committee, which backed Guzman, Foy and Roem. “Progressives will be seeking not just to elect Democrats, but to sweep in a whole new generation of rising and inspiring superstars.”

Democratic activists say they will move quickly to unite in pursuit of defeating Republicans after the primary, and some voters appeared to have already gotten that message.

In the 13th District race won by Roem, Jennifer Goforth voted for Mansimran Kahlon but said she would be prefer any Democrat over Marshall.

“He’s a homophobic, transphobic, racist bigot,” the 49-year-old said, adding that Marshall refused to shake her daughter’s hand after learning the teenager had founded a gay-straight alliance at her high school. “Before this year, everyone was so complacent that they didn’t care about local races. No more.”

Near the entrance of the polling place, Kahlon’s father and a volunteer for Roem promised unity as they passed out literature to voters.

“Whoever wins, we will all come together,” Avtar Kahlon said.

“Absolutely, we can’t have Bernie or bust here,” said Amy Cannon, a friend of Roem’s.

“With four candidates, we are going to get people out,” Kahlon said.

In Virginia Beach, Democrat Kelly Fowler defeated Tom Brock, who was pressured to drop out of the 21st District race over a series of racist and sexist Facebook posts.

Del. Bobby Orrock (R-Caroline) easily fended off a primary challenge from Nick Ignacio, who had starred in crude online videos performing lewd acts on sex toys.