The top-polling Democratic presidential candidates spent their campaign money at a rapid clip in the final three months of 2019, and they each entered 2020 with less than one-fifth of the money they had raised all year, according to financial reports filed Friday night.

The new filings show candidates were in need of a quick infusion of cash as they entered the final stretch leading up to the costly early contests, the first of which begins Monday in Iowa.

The primary campaign is expected to get even more expensive as it nears Super Tuesday on March 3, when 14 states have Democratic presidential nominating contests. And those who make it to Super Tuesday would face a rival with virtually unlimited funds: multibillionaire Mike Bloomberg.

The leading candidates spent heavily in the final quarter of 2019, buying millions of dollars of advertisements, paying for a sprawling staff and traveling from state to state.

Sens. Bernie Sanders of Vermont and Elizabeth Warren of Massachusetts, former vice president Joe Biden and former South Bend, Ind., mayor Pete Buttigieg spent all the money they raised in the final quarter, filings show.

And each entered January with less cash on hand than the previous quarter. Sanders had $18.2 million; Buttigieg had $14.5 million; Warren had $13.7 million; and Biden had $9 million, according to the new Federal Election Commission filings, which covered Oct. 1 through Dec. 31, 2019.

The 11 Democrats currently running in the race together spent $517 million in the fourth quarter alone, which includes the spending of two billionaires self-funding their campaigns.

The biggest spender of the quarter — aside from the two billionaires — was Sanders. His campaign spent nearly $50 million in the final quarter, pouring $20 million of that money into advertising.

Sanders’s heavy investments coincided with his ascent in the campaign — marking a dramatic revival for a candidate who struggled to gain traction over the summer and then suffered a heart attack in October that prompted some supporters to wonder if he would even continue his campaign.

Most other Democratic candidates had millions of dollars less than the top-polling candidates, such as Sen. Amy Klobuchar of Minnesota ($5 million), businessman Andrew Yang ($3.7 million) and Rep. Tulsi Gabbard of Hawaii ($2.8 million).

Meanwhile, President Trump continued to raise and spend record amounts of money for his reelection. Trump’s campaign, the Republican National Committee and two joint fundraising committees had a massive war chest of $196 million entering 2020, filings show.

Trump’s fundraising haul in the fourth quarter was fueled by backlash to the House impeachment of the president, campaign and party officials said.

Trump drew $57 million in the final six months of 2019 from donors giving in low amounts online to the campaign, the party and two affiliated fundraising committees, according to data from WinRed, the online fundraising platform for Republican candidates and groups. Of that, nearly $22 million came from 14 battleground and Rust Belt states, data shows, representing nearly 40 percent of donations that came in during the period. In comparison, 27 percent of the money donated to 2020 Democrats via the Democratic fundraising platform ActBlue came from those 14 states, data shows. Democratic presidential candidates raised $180 million on ActBlue in the second half of 2019, and $49 million came from the 14 battleground and Rust Belt states, records show.

The WinRed records, which cover the period from July 1 through Dec. 31, 2019, provided the first in-depth look at Trump’s base of online donors, who have driven massive amounts of money to Trump’s campaign since the 2016 election.

In the second half of 2019, the Trump campaign, Republican Party and two joint fundraising committees drew $5.6 million from Florida; $2 million from Pennsylvania; $1.9 million from Arizona; $1.8 million from Georgia; $1.7 million from Michigan and $1.6 million from North Carolina, WinRed data shows.

In an effort to help cash-strapped Democrats in the primaries, independent groups that can raise and spend unlimited amounts of money are stepping in with their own ad campaigns in early states. Despite candidates’ promise early on in the campaign to reject support from such groups, several presidential candidates are nonetheless being boosted by them.

For example, the pro-Biden super PAC Unite the Country raised $3.8 million in 2019 since it launched in late October, new filings show. The group’s fundraising was boosted by a $1 million donation from a single donor: San Francisco-based billionaire real estate broker George Marcus.

The super PAC raised another $3.8 million in January for a total of $7.6 million and plans on spending most of that on ads and research to help Biden in Iowa, officials said.

Bloomberg, who is running an ad-driven campaign with the hope of winning enough delegates on Super Tuesday, spent $200 million in the first six weeks of his campaign — exceeding the amount of money the rest of his Democratic rivals spent altogether in the fourth quarter.

His campaign spent about $188 million from mid-November through December, with the vast majority going to ads and advertising firms.

Trump’s huge reelection machine continued to drive money to his family business. In the final quarter of 2019, Trump’s reelection committee paid $193,000 to Trump-related properties.

As the president faces mounting legal bills from his impeachment trial, he is relying on money raised through the national party committee. In December, the RNC paid an additional $60,000 in legal fees to the law firm Raskin & Raskin, which is representing Trump in the impeachment proceedings.