Former New York City Mayor Michael Bloomberg is dropping out of the 2020 presidential race and endorsing former Vice President Joe Biden.

“Three months ago, I entered the race for President to defeat Donald Trump,” Bloomberg said in a statement Wednesday. “Today, I am leaving the race for the same reason: to defeat Donald Trump ― because it is clear to me that staying in would make achieving that goal more difficult.”

Bloomberg noted that his poor showing on Super Tuesday made the delegate math “virtually impossible,” acknowledging “a viable path to the nomination no longer exists.” Bloomberg only won the American Samoa Democratic caucus on Tuesday, failing to win any other primaries.

Bloomberg said Biden has the “best shot” to defeat Trump.

“I’ve known Joe for a very long time. I know his decency, his honesty, and his commitment to the issues that are so important to our country ― including gun safety, health care, climate change, and good jobs,” Bloomberg’s statement said. “I’ve had the chance to work with Joe on those issues over the years, and Joe has fought for working people his whole life. Today I am glad to endorse him ― and I will work to make him the next President of the United States.”

The billionaire businessman’s campaign made it into the top tier of a crowded field of Democratic candidates after he was late to enter the race in November.

Bloomberg, 77, was the richest person ever to run for the presidency, with a net worth estimated at $54 billion. Fellow billionaire Tom Steyer from California, who dropped out of the race in late February, has a net worth estimated at $1.6 billion, a fraction of Bloomberg’s.

At the start of Bloomberg’s campaign, as the candidate spent over $40 million on advertising, he drew swift criticism from fellow contenders who accused him of trying to “buy” the nomination. By the end of January, the billionaire had spent more than $400 million of his own funds on his campaign — blowing past previous records for the most spent by any primary candidate.

Two top contenders for the Democratic nomination have made billionaires a target of their campaigns: Sen. Bernie Sanders (I-Vt.) has long railed against the “billionaire class,” and a major proposal from Sen. Elizabeth Warren (D-Mass.) is a wealth tax on the ultrarich. Meanwhile, Bloomberg frequently reminded voters of his immense wealth during his campaigning.

Bloomberg had vowed in late February to stay in the race for the Democratic nomination “right to the bitter end.”

Rick Scuteri/ASSOCIATED PRESS Former New York City Mayor Mike Bloomberg, who was a late entrant in the race for the Democratic presidential nomination, speaks to reporters on Nov. 26 in Phoenix.

Bloomberg focused his campaign on defeating Trump, a common message among Democratic hopefuls, and touted his background as a businessman, former big-city mayor and philanthropist. Bloomberg has been an outspoken critic of Trump. Earlier this year, he called the president a “dangerous” man “who is recklessly running this country.”

In November, Bloomberg, a then-soon-to-be presidential candidate, told a crowd at a Black church: “I was wrong and I am sorry,” reversing his yearslong support of the policing strategy. Then in February, he claimed that he had “inherited” stop-and-frisk — even though police stops increased sevenfold during his time as mayor.

Fellow Democratic contenders, particularly Warren, came after Bloomberg for his alleged history of sexism and misogyny at his eponymous media company. At a February debate, Warren repeatedly demanded that Bloomberg release women from his company’s nondisclosure agreements, which are meant to silence women who have made sexual harassment and gender discrimination claims.

Bloomberg was a Republican when he was elected mayor of New York in 2001, but he re-registered as a Democrat in October 2018. The businessman served three terms as mayor from 2002 to 2013, the third term as an independent.

As a philanthropist, Bloomberg spent billions of dollars on issues like immigration and gun control, and in 2018 he donated millions to support Democrats in the midterm elections. After he entered the presidential race, he received criticism for his previous donations to Republican candidates who supported immigration and gun law reforms.

Paige Lavender contributed reporting.