New York City Mayor Bill de Blasio has dropped out of the 2020 presidential campaign, ending a campaign he waged in the shadow of better-known progressive candidates.

The 58-year-old launched his candidacy in May with the central slogan, "Working People First," and found himself in a crowded field of Democrats hoping to take on President Donald Trump in next year's election.

Mr De Blasio announced his exit, which leaves 19 Democrats vying to be the party's nominee, on MSNBC's Morning Joe show.

The mayor, who is barred from seeking a third four-year term in New York in 2021, struggled to build a national profile and stand out in a field that included former Vice President Joe Biden and a long list of experienced politicians.

Mr De Blasio had registered little support in polls and was eclipsed by progressive US senators Bernie Sanders and Elizabeth Warren.

President Trump greeted news of Mr de Blasio ending his presidential bid with sarcasm.

"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," Mr Trump tweeted earlier. "NYC is devastated, he's coming home!"

Mr De Blasio said on MSNBC that a "central reason" for his decision was the party's rules for qualifying for televised debates. He had failed to qualify for a 12 September debate that featured the 10 leading candidates for the party's nomination.

"The bar is so high so early that for a lot of us - clearly, some of my fellow chief executives, governors - couldn't make that cut," Mr de Blasio said. "It's clear to me it's a high bar, and that it's one I'm not going to be able to meet."

Mr De Blasio had emphasised during the campaign a list of progressive wins under his leadership, including universal pre-kindergarten, the end of the policing practice known as stop-and-frisk and paid sick leave, all in a city that has a bigger population, more than 8 million, than most US states.

NYC Mayor Bill de Blasio during a July Democratic Presidential Debate

Most New Yorkers had appeared unenthusiastic about de Blasio's presidential aspirations. A Quinnipiac University poll in April found more than three-quarters of New Yorkers did not feel he should make a White House bid.

Mayor Pete Buttigieg of South Bend, Indiana, which has a population just over 100,000, has won more support in national polls and regularly raised money in New York.

De Blasio's challenges were on display at one of his final campaign appearances at a presidential forum on Monday in Galivants Ferry town in South Carolina, an early-voting state. He spoke after US Senator Amy Klobuchar, Buttigieg and Biden as the sun set, but by that point, more than half of the audience had filed out.