Democrats in the most closely watched Virginia congressional districts came out on top in the latest fundraising reports, with significant cash-on-hand advantages as they head into the final stretch of the campaign.

Reps. Abigail Spanberger and Elaine Luria, Democrats who flipped red districts in 2018, each outraised her Republican challenger by hundreds of thousands of dollars, according to third-quarter campaign finance reports that were due Thursday night to the Federal Election Commission.

But the most notable disparity came in the historically red 5th District, where Democrat Cameron Webb took in $2.7 million, more than three times the $722,000 raised by Republican Bob Good. With less than three weeks until Election Day, Webb has roughly $1.2 million on hand compared with Good’s $380,855.

In the wake of Democratic gains in Virginia two years ago — Rep. Jennifer Wexton also flipped a seat blue — the National Republican Congressional Committee (NRCC) and the GOP-backing Congressional Leadership Fund have been spending money and resources as Republicans try to regain ground and claw the momentum back.

Nonpartisan analysts predict that Wexton’s 10th District seat is safe for Democrats this cycle, a testament to how much Northern Virginia has shifted politically.

And they say Webb might be able to pull off an upset in the 5th District, citing an energized Democratic electorate and Republican divisions after Good ousted Rep. Denver Riggleman in a June GOP nominating convention.

A Democrat has not won the seat since 2008.

Virginians are turning out in force at early-voting sites and requesting record numbers of mail-in ballots. In the 2nd and 7th districts, Spanberger, Luria and their opponents are vying for suburban centrists and independent voters.

Luria, whose district is concentrated on Virginia’s southeastern coast, raised $1.8 million in the third quarter, compared with Republican Scott Taylor’s $1.1 million. She has $1.4 million on hand. Taylor, a former state legislator who held the congressional seat for one term before losing to Luria two years ago, has $503,000.

The two Navy veterans are locked in an acrimonious rematch campaign, heavily focused on veterans’ issues and small-business aid.

Aside from hundreds of thousands in grass-roots donations for both candidates, Luria received more than $250,000 from the House Victory Project, which is devoted to maintaining a Democratic majority, while thousands poured in from unions and liberal political action committees. Taylor has accepted thousands from conservative PACs and the auto industry.

Luria has spent $3.1 million on ads, many of them devoted to attacking Taylor. Without a $2.2 million assist from the Congressional Leadership Fund, Taylor would be struggling to compete on the airwaves, figures from the Virginia Public Access Project show.

Spanberger, whose district is anchored in the Richmond suburbs, raised $2.4 million, while her opponent, state Del. Nick Freitas (R-Culpeper), raised $1.8 million. She has $2.5 million in the bank, while Freitas has $776,000.

Freitas has been helped by the Club for Growth PAC, devoted to electing fiscal conservatives. He accepted more than $300,000 in contributions from the group, plus roughly $100,000 from the House Freedom Fund and thousands from gun rights groups.

Spanberger received significant assistance from groups devoted to maintaining a Democratic majority in the House, with more than $250,000 from the House Victory Project.

To boost Freitas, the NRCC has relaunched old attempts to link Spanberger, a former CIA officer, to terrorism. One advertisement notes that she taught English literature for part of a school year at a Saudi-funded Islamic school — the NRCC calls it “Terror High” because a former student was convicted of joining al-Qaeda.

It is the same attack Republicans unsuccessfully waged against Spanberger in 2018 and has been described as “despicable” by Michael V. Hayden, whose career in the National Security Agency and CIA spanned three presidencies.

Freitas is running on a free-market platform pushing for minimal government regulation and intervention, especially in health care. He supports the repeal of the Affordable Care Act, drawing frequent attacks from the Democratic Congressional Campaign Committee.

Spanberger supports a public option and is campaigning as a moderate looking for bipartisan solutions to issues such as rural broadband access and lowering prescription drug prices, while also emphasizing her background in national security.

Spanberger, Luria and Webb also benefited massively from grass-roots donations through the digital donor platform ActBlue, with thousands of individual donors from Virginia and across the country bringing in between $945,566 and $1.69 million for each candidate.

Thousands of others contributed totals of $853,000 to Taylor and $946,000 to Freitas through the online portal WinRed.

Good, in contrast, raised just $5,391 through WinRed this quarter. Some of his greatest support appears to have come from Sen. Ted Cruz (R-Tex.), with a $73,200 contribution through the Cruz 20 for 20 Victory Fund. Cruz is also assisting Freitas with fundraising.

A self-described biblical conservative, Good challenged Riggleman in the nominating convention after the congressman officiated at the same-sex marriage of one of his aides.

During the general-election campaign, Good has positioned himself as a traditional law-and-order Republican, with strong support for President Trump’s agenda, holding numerous rallies with law enforcement groups. Trump won the district by 11 points in 2016.

Webb, a lawyer and doctor, is running on a platform focused on police and criminal justice reform. The son of a Drug Enforcement Administration officer, he has responded to attacks from Good and the NRCC by pointing to endorsements from several current and former sheriffs in central Virginia — including a former sheriff in Campbell County, where Good served as a board supervisor.

Webb’s fundraising report shows tens of thousands of dollars in donations from physicians associations, blue-collar unions and liberal outfits such as the League of Conservation Voters Action Fund and the Voter Protection Project, among others.

In Virginia’s U.S. Senate race, Republican candidate Daniel Gade raised slightly more than Sen. Mark R. Warner (D) in the third quarter but still has far less cash available.

Gade raised $2.4 million and Warner raised $2.2 million, although Warner’s campaign spokeswoman says the senator brought in an additional $400,000 for the Democrats’ Virginia Coordinated Campaign, which also funds his organizers.

Warner, who is leading in polls by double digits, has $6.4 million on hand. Gade has about $343,000.