RICHMOND — Outside groups trying to sway Virginia’s four competitive congressional races have been plowing most of their money into the Richmond-area race between Rep. Dave Brat (R) and Democrat Abigail Spanberger.

Since Oct. 1, committees independent of the candidates have lavished $2.2 million on TV and social media ads in the 7th Congressional District, according to the nonpartisan Virginia Public Access Project.

That sum dwarfs the $1.4 million that outside groups spent over the same period on the 10th District contest between Rep. Barbara Comstock (R) and state Sen. Jennifer Wexton (D), who are competing in the more expensive Northern Virginia media market.

The Comstock-Wexton matchup had long been billed as one of the country’s most competitive races, but polls show Wexton up by double digits in a district hostile to President Trump. The spending surge in the Brat-Spanberger contest suggests that partisans on both sides have shifted their focus down state.

The 7th District, a rural-suburban mix that stretches from Culpeper County to Nottoway County, is a longtime GOP stronghold, but the party has seen its margins shrink over recent election cycles. Public polls have indicated the race is tight.

Brat won the seat four years ago after pulling off a shocking primary upset over Rep. Eric Cantor, then the House majority leader. He won reelection two years ago by 15 points, but Republicans and Democrats alike believe the seat is in play in the era of Trump, who has many fans in the district’s rural areas but foes in its suburbs.

Spanberger, a former CIA operative, is widely seen as a strong challenger. She has played up her national security credentials in a way that could appeal to swing voters and moderate Republicans.

The Cook Political Report classifies the race as a toss-up.

The outside money in the district is heavily on Brat’s side. Conservative and Republican groups are spending one-third more on pro-Brat and anti-Spanberger ads as liberal and Democratic groups are shelling out for pro-Spanberger and anti-Brat spots.

The independent groups hoping to boost Brat are: House Freedom Fund, which has spent $457,309; the Congressional Leadership Fund ($385,407); Heritage Action for America ($243,188); Americans for Prosperity ($122,116); Hometown Freedom Action Network ($40,000); and FreedomWorks for America ($20,000).

The spenders on Spanberger’s side are: House Majority PAC ($432,265); League of Conservation Voters ($326,848); NARAL Pro-Choice America ($171,500); Priorities USA Action ($14,161); and Progressive Turnout Project ($13,721).

Outside spending is far lower in two other competitive House races. It totals $75,1842 in the 2nd Congressional District. Rep. Scott W. Taylor (R-Va.) faces Democrat Elaine Luria in that district, which is largely Virginia Beach but also touches Norfolk, parts of Hampton and Williamsburg, and the entire Eastern Shore of Virginia.

Independent groups have spent $66,837 in the 5th District, where two political newcomers — Democrat Leslie Cockburn and Republican Denver Riggleman — are running for the seat being vacated by Rep. Tom Garrett (R). The largely rural district runs from the Northern Virginia exurbs to the North Carolina line and includes the college town of Charlottesville.