Joe Biden’s presidential campaign brought in $22.7 million during the fourth quarter of 2019, a fundraising haul that was a significant improvement from earlier months but put him well below some rivals.

The total made it Biden’s most successful fundraising quarter yet, with the campaign attributing the boost to President Trump’s attacks and the impeachment proceedings. The campaign said more than half of the donors were first-time contributors to Biden.

“I just want to thank you for putting yourself on the line, vouching for me, vouching for my family,” Biden said in a video message. “I appreciate it a great deal. So thank you, thank you, thank you.”

Earlier Thursday, Sen. Bernie Sanders (I-Vt.), who is also seeking the Democratic nomination, announced that his presidential campaign had raised $34.5 million in the last three months of 2019, while businessman Andrew Yang reported raising $16.5 million.

Pete Buttigieg announced on Wednesday — his last day as mayor of South Bend, Ind.— that he had raised $24.5 million. Trump’s campaign said Thursday that impeachment helped him pull in $46 million in the fourth quarter.

Sen. Elizabeth Warren (D-Mass.) has yet to announce her figures, but her campaign was forecasting an amount lower than that brought in by Sanders, Buttigieg and Biden, with a goal of $20 million for the quarter.

The latest figures were a positive reversal for Biden, whose campaign struggled to gain financial momentum in the third quarter of 2019. He also burned through money at a faster clip — including nearly a million dollars on charter jet travel — while having a smaller campaign chest than his top competitors, according to campaign filings.

In October, he dropped his long-standing opposition to a super PAC that would supply a jolt of cash to bolster his campaign. The change in stance, while potentially problematic to some party voters, was a recognition that fundraising difficulties had become a problem for Biden’s presidential aspirations.

“As president, Joe Biden will push to remove private money from our federal elections. He will advocate for a constitutional amendment to overturn Citizens United and end the era of unbridled spending by Super PACs,” deputy campaign manager Kate Bedingfield wrote. “Until we have these badly needed reforms, we will see more than a billion dollars in spending by Trump and his allies to reelect this corrupt president.”

Biden’s campaign said online donations doubled during the fourth quarter compared with the third. The average revenue raised online more than doubled during impeachment proceedings, the campaign said.

The average online contribution in the fourth quarter was $23, while the overall average was $41. The most common occupation among the donors, Biden’s campaign said, remains educators.

Biden has continued to raise money at fundraisers hosted by wealthy donors, even as opponents have said events such as those attended by Biden and Buttigieg sell political access to the country’s richest people.

Biden has also raised money off Trump’s unfounded claims about his actions in Ukraine. During recent swings through Iowa, as well as in emails and text messages to supporters, Biden has repeatedly told voters that Trump and Republicans have spent millions to prevent him from becoming the Democratic nominee.

“These numbers clearly demonstrate Donald Trump’s lies and attacks on the Vice President have only cemented and expanded his support, serving as a constant reminder to Democratic primary voters that Trump is terrified by the idea of facing Joe Biden in a general election,” Biden campaign manager Greg Schultz said in a statement.