President Trump’s campaign and affiliated committees raised more than $21 million in the final three months of 2018, entering the presidential election cycle with a massive head start just as a wide-open Democratic field begins to take shape.

The latest fundraising disclosures bring the total haul for Trump’s reelection effort to more than $129 million, a record amount for a sitting president at this point in the election cycle. The campaign had more than $19.2 million in cash on hand by the end of 2018, according to new Federal Election Commission filings made public Thursday night.

Meanwhile, as many as two dozen Democratic candidates may vie for the party’s nomination in what is expected to be a bruising and expensive primary battle. These candidates are now gearing up their ability to raise money, and are far behind Trump’s fundraising pace.

For example, the Senate campaign committee of Sen. Elizabeth Warren (Mass.) had $11 million by the time she announced her candidacy on Dec. 31, FEC filings show. This money can be transferred to her presidential campaign, but much of it is expected to be spent in the primaries.

Trump’s enormous haul in the fourth quarter came even as the president’s party lost its majority in the House during the midterm elections, and as Trump’s demand for a wall at the U.S.-Mexico border led to a partial shutdown of the federal government and sagging presidential approval ratings.

Trump continued to be buoyed by an avid small-donor base. Nearly 75 percent of the money Trump raised during the period came from donors giving in sums of $200 or less, FEC records show.

“This is a true testament to President Trump’s fulfillment of his promises made to the forgotten men and women of America,” Michael Glassner, chief operating officer for the campaign, said in a statement.

Trump’s business is drawing a steady stream of revenue from his campaign activities. Trump’s campaign and its affiliated fundraising committees spent nearly $193,000 at Trump properties, including rent at the Trump Tower in New York City, FEC records show.

The Trump campaign committee’s legal fees declined after a surge in such payments in the previous quarter. In the final three months of 2018, the campaign paid nearly $834,000 in legal fees, including $188,700 going to Jones Day, which represents the campaign in the investigations by special counsel Robert S. Mueller III and several congressional committees into Russian interference in the 2016 election.

A fund set up to help pay legal expenses incurred by aides to Trump drawn into the Russia investigation raised $500,000 in the final quarter of 2018 — all of it coming on Oct. 1 from casino mogul Sheldon Adelson and his physician wife, Miriam, according to documents filed with the Internal Revenue Service. The Adelsons are prolific donors to Trump and the Republican Party.

The campaign spent more money in the final quarter of 2018 than it took it. Its spending spiked to $23 million, which was more money than in previous quarters. The expenses came as Trump criss-crossed the country holding rallies, ran ads and made direct donations to the Republican National Committee and to Republican campaigns to support the party’s prospects in the midterm elections.

The Trump campaign owes $1 million in travel expenses to the U.S. Treasury, filings show, likely for the use of government resources as the president traveled to hold midterm rallies.

In addition to the Trump campaign and affiliated fundraising committees, the RNC continued to show its financial strength, entering 2019 with $23.5 million in its coffers.

And the pro-Trump America First operation — a super PAC and an affiliated nonprofit — raised more than $75 million in the 2018 cycle in its effort to boost Trump’s policies and allies in Congress, a spokeswoman said Thursday.

Unlike his predecessors, who waited until after the midterms to raise money for their reelection campaign, Trump began raising money for 2020 shortly after winning the presidency.

Still, after a battle over the border wall — his signature campaign promise, aimed at curbing illegal immigration — that led to the longest shutdown in the country’s history, there are signs of danger for Trump’s reelection hopes.

A 56 percent majority of all Americans say they would “definitely not vote for” Trump should he become the nominee, according to a new Washington Post-ABC News poll.

Some Republicans have hinted they may challenge Trump in the party primaries. And nearly one in three Republicans and GOP-leaning independents said they would like to nominate someone other than Trump to be the Republican presidential candidate in 2020, the poll found.

Amid these threats, the RNC last week unanimously voted for a resolution of “undivided support” for Trump and his presidency.

“President Trump and Chairwoman [Ronna] McDaniel’s record-breaking fundraising has put us in an unprecedented position for 2020,” RNC spokeswoman Cassie Smedile said. “The RNC is working with the campaign in ways that have never been done before to ensure we have the most robust and efficient election operation in history.”

Trump continues to draw a significant amount of money from his small-dollar donor base, including from supporters giving $5 at a time in response to online donation requests or purchasing “Make America Great Again” gear.

These supporters injected millions into Trump’s campaign and affiliated fundraising committees in the final three months of 2018, the campaign said, responding in part to fundraising appeals timed around the November elections, the recount in Florida in which Trump ally Ron DeSantis prevailed in his bid for governor, and Trump’s burgeoning fight with Democrats over funding for a border wall, which bled into the beginning of 2019.

“I promised you that the forgotten men and women of this great country would be forgotten no more and that I would NEVER stop fighting for you,” read an email sent Dec. 21. “Today, Democrats are making it clear that they value ILLEGAL IMMIGRANTS MORE THAN HARD-WORKING AMERICANS! NONSENSE!”

The next day, the federal government entered a partial shutdown and remained closed for 35 days.