The party’s top Senate super PAC pulled down several weeks’ worth of ads in those two Southern states in recent weeks, per information shared with Semafor, saving $22 million in North Carolina and $11 million in Georgia.

The Democratic Senatorial Campaign Committee also scrapped some ad buys in both states down the stretch, decisions that paid off as the party won both seats early on Tuesday night. Democrats felt optimistic about taking the majority earlier in the night than some had expected after the shocking win in South Carolina.

Their decision to pull cash out of Georgia and North Carolina helped top Democratic groups approve new Senate spending in states like Mississippi, South Carolina, and Kansas. It also helped the party shore up candidates in the battleground states of Michigan and Maine as Republicans’ deep-pocketed Senate Leadership Fund super PAC poured in astounding sums.

“The strength of the Cooper and Ossoff campaigns allowed Senate Majority PAC to re-invest our initial investments into our expanded battleground map. That is a game-changer when Republicans poured money into races,” said Lauren French, a spokesperson for Senate Majority PAC.

Senate Majority PAC spent heavily in Kansas on top of its spending in traditional battlegrounds, while the DSCC put in $500,000 in South Carolina’s Senate race late, according to a person familiar with the buy. That spending followed $500,000 in Mississippi previously reported by Semafor.

That was only possible due to the strength of Ossoff and Cooper, who both raised gobs of money and put away their opponents weeks ago. Cooper raised more than $49 million through mid-October, and Ossoff raised more than $100 million.

Cooper and Ossoff are both notching considerable, double-digit victories over their respective opponents, Rep. Mike Collins and Michael Whatley.