There is officially only one mayor left in the 2020 presidential race — and it is the one who runs a city of 100,000 rather than the chief executive of the biggest city in the United States. On Friday, New York City Mayor Bill de Blasio ended his bid for the Democratic presidential nomination — leaving us now with 18 major candidates remaining, per FiveThirtyEight’s definition.

However, the list of candidates with realistic shots at winning the nomination may be even shorter than that; just 10 candidates met the polling and donor thresholds to participate in last week’s Democratic debate in Houston. And de Blasio was not among them, nor did it seem possible for him to qualify for the next debate, in Ohio in October. As of July, only 6,700 people had donated to his campaign (debaters need 130,000), and he has only hit 2 percent support in a handful of polls all year long (none of which are counted by the Democratic National Committee for debate qualification). In short, it’s no mystery why de Blasio called it quits.

De Blasio was always an extreme long shot. He entered the race quite late, on May 16 — after more than 20 other major candidates had declared and the field was already drawing headlines for being historically saturated. In fact, only one successful presidential nominee since 1976 (Bill Clinton) kicked off his campaign later than de Blasio did. And although de Blasio was arguably one of the most progressive candidates in the field — having brought universal pre-K and other liberal reforms to the five boroughs — he was crowded out of the primary’s left lane by the likes of Sens. Bernie Sanders and Elizabeth Warren, who combined for 56 percent support among “very liberal” voters in the most recent Quinnipiac poll (de Blasio had less than 1 percent).

But probably de Blasio’s biggest problem was simply that Democratic voters did not like him, which is quite an unusual place to be among voters of one’s own party. In an average of national polls of 2020 candidates’ favorability from May, de Blasio was the only candidate at the time whom more voters viewed unfavorably than favorably (his net favorability rating — favorable rating minus unfavorable rating — was -1). That’s especially bad because de Blasio wasn’t some little-known candidate; 46 percent of Democrats were able to form an opinion of him. All other candidates who were at least as well-known had net favorability ratings of +21 or better!

It is very difficult to win a presidential nomination when you are well-known but not well-liked among voters in your party early in the campaign. Only one candidate has done so since 1980 — President Trump, who went from a -42 net favorability rating among Republicans in May 2015 to a +28 net favorability rating that September. But Trump had the advantage of tons of earned media coverage, something no future candidate could bank on. De Blasio certainly didn’t get it, appearing in less than 1 percent of cable-news clips the week of Sept. 8, for example. And unsurprisingly, his net favorability rating failed to improve; in fact, it actually dropped over the course of the campaign (it was -6 in our average of August polls).

One group with whom de Blasio became especially unpopular this summer? His own constituents. According to the Siena College Research Institute, de Blasio’s net favorability rating in New York City dropped from -1 point in March to -25 points in September. And there has been a lot of grumbling among New Yorkers about all the time de Blasio was spending out of state — such as when a blackout struck Manhattan and the mayor was campaigning in Iowa, or reports that de Blasio spent just seven hours at City Hall during the month of May.

Although term limits prevent de Blasio from seeking another term as mayor, his doomed presidential campaign may have drained whatever political capital he had remaining in his last two years as mayor. And although running for president is often portrayed as a risk-free way for politicians to build a national profile, de Blasio’s campaign is a cautionary tale that there can be major downsides as well.