Anthony Weiner's mayoral campaign ended with him dead last in the count and being chased by Sydney Leathers through a McDonald's while searching for a back entrance to his election night party.

Ms Leathers is one of the former sexting paramours of Mr Weiner, who went by the alias "Carlos Danger". She has since parlayed her minor notoriety into a porn career.

There's no doubt about it, we have the best ideas. Sadly, I was an imperfect messenger.

She had staked out the party, telling waiting media that she wanted to “confront him”. She passed the time posing for photos while his minders quietly sought out the alternative entrance via the McDonald's outlet.

Mr Weiner, who captured 4.8 per cent of the vote in his campaign to be the Democratic candidate for New York City mayor, made it to the stage to tell supporters: "There's no doubt about it, we have the best ideas. Sadly, I was an imperfect messenger."

Advertisement

"Now, sadly, we did not win this time. But I could not be more proud of the campaign we ran."

He then raced out to his car, stuck his middle finger up at the media through the window, and disappeared into the night.

Sydney Leathers, who engaged in online sex chats with Anthony Weiner last northern summer, tries to enter his election gathering place at Connolly's Pub in midtown Tuesday, in New York. Photo: AP

Things didn't end well for Eliot Spitzer either. The former New York governor and attorney-general, who came undone when he was caught visiting prostitutes, failed in his bid to resurrect his political career by running for position of comptroller of New York City. By comparison to Mr Weiner, Mr Spitzer ran a good - or at least more tempered - campaign and his failure has prompted some to fret that New York has turned puritanical.

Manhattan Borough president Scott Stringer will be the Democratic candidate for the key financial post.

The campaign also didn't end well for the current mayor, the term-limited billionaire Michael Bloomberg, if only because the eventual winner of the Democratic Primary on Tuesday was the city's Public Advocate, Bill de Blasio, who ran a determinedly anti-Bloomberg campaign.

Democratic candidate for Mayor Bill de Blasio, top centre, with his family, celebrates his primary win. Photo: AFP

He has portrayed Mayor Bloomberg's New York as a place for tourists and the ultra-rich, a place were life has became harder for its middle-class citizens. He has constantly attacked Mr Bloomberg for the NYPD's controversial stop-and-frisk policy, in which thousands of black youths are bailed up regularly on city streets.

Mr Bloomberg, perhaps stung by Mr de Blasio's criticism, attacked him for running a racist campaign in a Q and A session with New York magazine. Mr Bloomberg's claim, which he quickly modified, was that Mr de Blasio emphasised his racially mixed family in advertising in order to win votes.

"I think it's pretty obvious to anyone watching what he's been doing," Mr Bloomberg said of Mr de Blasio. "I do not think he himself is racist. It's comparable to me pointing out I'm Jewish in attracting the Jewish vote."

Mr de Blasio's wife is African-American and their son, Dante, who boasts a distinctive 70s-style Afro, appeared in one of his father's ads, saying his dad "is the only Democrat with the guts to really break from the Bloomberg years".

Mr Bloomberg's legacy is also threatened by Mr de Blasio's victory, as he defeated Christine Quinn to win. Ms Quinn is the Speaker of the New York City Council, and had positioned herself as the successor to Mr Bloomberg, a woman suited to maintaining Mr Bloomberg's policies.

Mr de Blasio built his support around the slogan "a tale of two cities", and in doing so apparently read the mood of primary voters correctly. As has been widely noted, he becomes the first non-Jewish white person to win the Democratic candidacy in New York in 44 years.

"There's a tremendous sense of economic insecurity," he was quoted as saying in 2011. "You feel it particularly intensely in the outer boroughs, you feel it in families that consider themselves solidly middle-class but are worried - they're worried about the consistency or the durability of their job, they're worried about whether they can pay for their kids' educations. And then I think, of course, every election is to some extent a referendum on the previous officeholder. [By 2013] there will be incredible Bloomberg fatigue."

At his victory party, Mr de Blasio returned the theme, telling supporters: "What we have achieved here tonight and what we will do in the next round of this campaign won't just change the view of how things look inside City Hall but the policies that have left behind so many New Yorkers."

At present, it looks as though Mr de Blasio has just met the 40 per cent threshold that would save him from having to go into a run-off to finally secure the candidacy.

The Republican primary — a race that has attracted far less attention the Democratic political carnival - was won by Joe Lhota, the former chief of the Metropolitan Transportation Agency and a former aide to Mayor Rudy Giuliani.

Mr Bloomberg has not made it clear what he plans to do next except to say that he will not retire. He has put his voice and bank account into a battle to increase gun control and his philanthropic interests are as vast as his fortune.

Nobody is quite sure what Anthony Weiner will do, either. He has dedicated his life to becoming New York's mayor, a point he never denied even during his 12 years in Congress.

Many believed he only stayed in the race after his second sexting scandal in order to win enough votes to make the argument one day in the future that he remained a viable candidate.

That hope appears to have been crushed, though it is hard to imagine he will disappear from public view for too long.