Long before Joe Biden was smashing online fundraising records, long before it was clear he would become the Democratic nominee, his campaign was facing a serious cash crisis.

It was late summer 2019 and Biden’s online fundraising had slowed to such a trickle that his team basically had to shut down its digital advertising program. His aides knew the choice was self-defeating: No more online ads meant no more finding new donors. The campaign bottomed out in early September 2019 when Biden raised just $24,124.17 online in a day.

Now? On one recent day, Biden was raising more than that every two minutes.

The unlikely transformation of Biden, a 77-year-old whose seemingly limited appeal to small donors left him financially outflanked in the primaries, into perhaps the greatest magnet for online money in American political history is a testament to the ferocity of Democratic opposition to President Donald Trump.

In a little over a year, the former vice president’s online fundraising had increased 1,000-fold, to $24.1 million on Sept. 30.

Biden now has a once-unimaginable cash edge over Trump, and since Sept. 1 he has reserved about $140 million more in television advertising than the president. Money alone does not determine presidential winners — Hillary Clinton vastly outspent Trump in 2016 — but the cash has provided Biden enviable flexibility to engineer the electoral map to his advantage.

“There was always going to be a large amount of money coming into the nominee,” said Michael Whitney, a Democratic digital fundraising specialist who worked for Sen. Bernie Sanders in the primary. “I’m sure they never dreamed it would be this big.”

To chart Biden’s consequential financial turnabout, the New York Times analyzed the flow of nearly 11 million online contributions from the first nearly 500 days of his campaign. The analysis looked at $436 million given through August to Biden and his shared committee with the Democratic National Committee via ActBlue, the donation-processing platform. Checks, merchandise sales and other offline giving were not included.

The Times analysis shows four inflection points in Biden’s fundraising metamorphosis, beginning with one unwittingly provided last fall by Trump, whose presidency has been rocket fuel for Democratic fundraising.

The other three points — all linked in different ways to race — emerge from the 2020 data: Biden’s sweeping victories delivered by Black voters in South Carolina and on Super Tuesday, the protests after the police killing of George Floyd and, especially, the selection of Sen. Kamala Harris as his running mate.

Harris, in particular, turbocharged his fundraising. Biden’s previous high for online donations in a day had been 102,143 contributions. On Aug. 11, the day he picked Harris, he received 252,982. The day after, he topped 300,000.

Biden’s committees raised a record-shattering $364.5 million in August, including $205 million online. Then he bested that total in September, officials said.

The first event that reversed Biden’s financial trajectory came not long after he had scrapped his ad budget: the September 2019 news that Trump had pressured the president of Ukraine to investigate Biden’s son. That act eventually spurred the president’s impeachment. For many Democratic primary voters, it also was a blunt reminder of Biden’s polling strength against Trump.

In the 40 days before the call burst into view, on Sept. 20, 2019, Biden had raised about $62,500 online per day, on average; in the 40 days that followed, he averaged over $159,000.

It was something of a financial lifeboat. Over the previous three months, Biden had been spending more than he raised, depleting his cash reserves. The extra $100,000 a day helped keep the campaign afloat, officials said.

Kate Bedingfield, a deputy campaign manager for Biden, said that Trump’s seeking help from Ukraine “made it clear to the whole world which candidate he feared facing most.”

“And we capitalized on that in a way that produced real results,” she said.

Biden’s average daily haul would never again dip below the six-figure mark.