New York City Mayor Bill de Blasio ended his campaign for the 2020 Democratic presidential nomination on Friday after struggling to gain traction in a sprawling field of candidates.

Announcing his decision in an MSNBC interview, de Blasio did not throw his support behind any candidate but said he would support the eventual Democratic nominee "with energy."

"I feel like I've contributed all I can to this primary election, and it's clearly not my time," de Blasio told the hosts of "Morning Joe." "So I'm going to end my presidential campaign, continue my work as mayor of New York City, and I'm going to keep speaking up for working people and for a Democratic Party that stands for working people."

President Donald Trump, no fan of de Blasio, tweeted : "Oh no, really big political news, perhaps the biggest story in years! Part time Mayor of New York City, ΓåòBilldeBlasio, who was polling at a solid ZERO but had tremendous room for growth, has shocking dropped out of the Presidential race. NYC is devastated, he's coming home!"

Trump added later that the 6-foot-5 mayor "only had one real asset. You know what it was? Height. Other than that, he had nothing going. "

De Blasio joins New York Sen. Kirsten Gillibrand, Washington Sen. Jay Inslee, Massachusetts Rep. Seth Moulton, former Colorado Gov. John Hickenlooper and California Rep. Eric Swallwell, who have all left the Democratic primary race.

The 58-year-old mayor launched his bid in May but his campaign largely failed to take off. He never achieved higher than 1% in a national poll and was ridiculed in the media, most recently in a Washington Post story headlined "Bill de Blasio's presidential campaign has burned down, fallen over and sunk into a swamp."

He qualified for the first two rounds of debates but failed to make the September debate stage and appeared unlikely to qualify for the October debates.

De Blasio struggled to achieve the breakout moment he needed to stand out in the crowded Democratic field. After a strong performance in the first round of debates in June he flubbed a campaign appearance in Miami by quoting Che Guevara. De Blasio said he did not know that the slogan "Hasta la victoria siempre!" was associated with Guevara, a leader of the Cuban Revolution who is reviled by much of Miami's Cuban population.

De Blasio boasted of his administration's record on police reform but was followed around on the campaign trail both by protesters from the city's largest police union and by hecklers demanding that he fire the officers involved in the 2014 death of Eric Garner on Staten Island. The protests did not end after the Aug. 19 firing of Officer Daniel Pantaleo, who placed Garner in the chokehold that contributed to his death. An activist interrupted de Blasio's Aug. 25 CNN town hall to demand that other officers who were also present during Garner's arrest be fired.

Critics complained that de Blasio, who is term-limited and must leave office at the end of 2021, was running for president because he was bored with his day job.

The New York Post, a frequent de Blasio antagonist, reported that records showed that the mayor spent only seven hours at City Hall in May, the month he announced his presidential race. (The mayor's office challenged that figure, saying it was actually 11 hours.)

De Blasio countered that he was fully engaged with running the city despite his frequent trips to early-voting states, but his meet-and-greets there drew sparse crowds and never produced a spark that could have ignited a serious presidential campaign.

The campaign descended into farce at one point when de Blasio Skyped into a union conference in Iowa but a technical glitch made him sound like a chipmunk.

De Blasio announced his presidential run by heading to the Statue of Liberty, where he said the country is in an "identity crisis" around immigration, which he called "the founding and unifying element of the American experience."

"We are figuring out who we are," he said then. "There are American values we need to return to and fight for in order to achieve our greatest potential."

On his campaign's first day, he dived into an insult match with Trump.

"He's a con artist. I know his tricks. I know his playbook," the mayor said.

Trump tweeted at the time that de Blasio was "considered the worst mayor in the U.S."

The Republican president said, "He is a JOKE, but if you like high taxes & crime, he's your man. NYC HATES HIM!"

When de Blasio took office in 2014, he seemed briefly poised to become a leading voice for an emerging left wing of the Democratic Party. His central message was fighting income inequality, a theme he hit in the video announcing his presidential candidacy.

"There's plenty of money in this world. There's plenty of money in this country. It's just in the wrong hands," he said.

But liberals' enthusiasm for de Blasio faded during his first term as mayor, partly because of political missteps and partly due to the emergence of a new generation of progressive stars like Democratic Rep. Alexandria Ocasio-Cortez.

With fellow progressives Elizabeth Warren and Bernie Sanders occupying two of the top three spots in Democratic polling, there never seemed to be a lane for de Blasio.

"There was no rationale for his campaign," said Matthew Dallek, a political historian at George Washington University. Dallek said the campaign "will be seen as a pretty unfortunate blip in the history of the 2020 primary."

Joseph Viteritti, a political scientist at Hunter College who has written a book about de Blasio, "The Pragmatist: Bill de Blasio's Quest to Save the Soul of New York," said running for president "wasn't one of his better decisions."

"He got a bit of national exposure, was able to add one more progressive voice to the national debate about the future of the Democratic Party, which I think is important, but he didn't have to become a candidate to do that," Viteritti said.

Even supporters of de Blasio were skeptical about the campaign. Democratic consultant Rebecca Katz, a former de Blasio adviser, tweeted Friday, "Bill de Blasio has two more years to communicate the actual good he's done in NYC, work on a better relationship with the reporters who cover him and the elected officials who should be with him, and get more things done for the people of this City. I hope he succeeds."

De Blasio said he had no regrets about his failed White House run.

"I feel very good about the message," he told a news conference later Friday. "I feel that people want progressive change. They want to focus on these working people. The message resonated real well." But he admitted, "We were watching the polling to see if anything was moving, and it just wasn't moving."

------

Associated Press reporter Stephen R. Groves contributed