Ed Gillespie, left, is the Republican gubernatorial candidate in Virginia; Lt. Gov. Ralph Northam is the Democratic candidate. (Bill O'Leary/The Washington Post)

Virginia Republican gubernatorial candidate Ed Gillespie started to close a financial gap with Democratic rival Ralph Northam in October, new filings show.

Gillespie raised $9.7 million between Oct. 1 and Oct. 26, while Northam pulled in nearly $11 million, according to records compiled Tuesday by the nonpartisan Virginia Public Access Project (VPAP).

The late flood of campaign money is unprecedented in modern Virginia history, according to VPAP. Together, Gillespie and Northam raised almost twice what the gubernatorial contenders collected in the same period four years ago.

Northam, the state’s lieutenant governor, also significantly outspent Gillespie in October, $15 million to $10.7 million. Doing so meant losing the 2-to-1 cash advantage he had over Gillespie since the summer.

With 12 days before Election Day, Northam had $1.7 million left in campaign accounts to Gillespie’s $1.4 million. Libertarian candidate Cliff Hyra raised $11,000 in the October period, ending with about $5,000 on hand.

The Republican Governors Association on Monday gave $2.8 million to Gillespie’s campaign — the largest single donation to a gubernatorial candidate in recent memory, according to VPAP.

The newly formed National Democratic Redistricting Committee, chaired by former U.S. attorney general Eric H. Holder Jr. to target state-level races, gave an additional $200,000 to the Democratic Party of Virginia on Tuesday.

The tightening of the money race comes as most polls show Northam with a slight lead or in a dead heat with Gillespie, a longtime GOP operative. Virginia’s governor’s race is widely viewed as a test of politics in the era of President Trump and a hint of what’s to come in next year’s midterm elections.

Gillespie has been airing hard-edge ads seeking to tie Northam to MS-13 gang violence and a sex offender who briefly got his rights restored. Northam countered with a commercial blasting Gillespie's ads as "false attacks" and "despicable," while the Latino Victory Fund released a controversial commercial featuring a Gillespie supporter in a pickup truck chasing a group of minority children.

The ad was pulled late Tuesday after a terrorism attack in New York City in which a rental truck ran down people on a bike path.

Virginia does not limit campaign donations and allows outside groups to coordinate directly with campaigns — allowing for money to gush into competitive contests.

The latest stories and details on the 2017 Virginia general election and race for governor.

Gillespie's earlier fundraising troubles raised questions about why a well-connected former head of the Republican National Committee — and a lobbyist and consultant for Fortune 500 companies — wasn't able to keep up.

In the October filing period, the Republican Governors Association poured $4.75 million into Gillespie’s bid, nearly half his haul. He also received $250,000 from Marlene Ricketts, a conservative donor who bankrolled an effort to stop Trump from securing the GOP nomination. Investment banker and GOP donor Thomas Saunders and Haulover Creek Development Co. each pitched in $100,000.

Progressive groups and unions kept the spigots flowing for Northam. In addition to $3.2 million from the Democratic Governors Association, Northam received $560,000 from the gun-control group Everytown for Gun Safety Action Fund and roughly $300,000 from the Virginia League of Conservation Voters.

Candidates’ financial reports don’t capture the full money picture in Virginia’s governor’s race because of the involvement of outside groups.

On the Republican side, the Koch brothers' Americans for Prosperity is spending at least $2.8 million on anti-Northam advertising.

Northam also has a constellation of progressive groups running field and digital operations to help him, but not all of it is reported as "in-kind" financial support.

Republicans were also catching up financially in other statewide contests — which also saw record-shattering late money.

In the race to succeed Northam as lieutenant governor, Republican Jill Holtzman Vogel, a state senator from Fauquier County, raised $1.4 million to Democrat Justin Fairfax’s $1.3 million.

Earlier fundraising leads allowed Fairfax to maintain his advantage in available cash, with $518,000 as of Oct. 26 to Vogel’s $124,000.

But Vogel may have closed that gap: Her father, businessman William Holtzman, lent her $400,000 the day after the filling period ended. He had previously given her $650,000.

Democratic Attorney General Mark R. Herring's bid for a second term has also attracted a flood of money from national groups.

Herring collected $2.7 million, about $1 million of which came from the Democratic Attorneys General Association.

His Republican challenger, John Adams, raised $3.4 million in October, the vast majority of which came from the Republican Attorneys General Association. The GOP group gave another $2.2 million after the filing period closed.

Herring ended the period with $1.5 million, while Adams had about $170,000, excluding the new infusion from the Republican Attorneys General Association.

Also on Tuesday’s ballot are candidates for all 100 seats in the House of Delegates, where Republicans have a 66-to-34 majority.

Topping the fundraising charts was a heated contest in a southwest Virginia district carried by Hillary Clinton in November.

Republican incumbent Joseph Yost raised $535,000 in October, much of it from fellow GOP lawmakers. His Democratic challenger, Chris Hurst, a former TV anchor whose girlfriend was fatally shot during a live broadcast, raised $483,000. Both ended the period with about $127,000.

In all, Democratic candidates raised $6.4 million in October to Republicans’ $4.7 million. But Republicans have accumulated a war chest over years of incumbency in the state legislature, leaving candidates with $5.5 million heading into the campaign’s final stretch to Democrats’ $2.7 million.

The political action committees of Republican and Democratic House leaders were not required to file finance reports for October, leaving an incomplete picture of finances in those contests.