It wasn't so long ago that the campaign to become New York's next mayor was saturated with lewd pictures and anatomical puns, less a political contest than a detour into some misbegotten film by Woody Allen.
But as a crucial phase of the election draws to a close, something unexpected has happened.
The race is no longer about the candidate with a penchant for sexting. It's not even about the candidate who was tipped to make history as the city's first female and gay leader. Instead, it's about the come-from-behind surge by the candidate who has highlighted the gap between rich and poor – in other words, the anti-Michael Bloomberg.
On Tuesday, the city's Democratic voters go to the polls to select their candidate for mayor. Surveys indicate that Bill de Blasio, currently the city's public advocate – an elected ombudsman – now has a commanding lead in the primary race.
His rise in the polls has been swift and dramatic, propelled by a consistent message that until weeks ago was drowned out by the personal dramas of Anthony Weiner.
"The issue in this election is how do we address inequality," said Mr. de Blasio on Wednesday as he greeted voters on a street corner in Manhattan, pointing out that 46 per cent of the city's residents live at or near the poverty line. "It's going to take a very different approach from the one that Michael Bloomberg used."
Mr. Bloomberg, a self-made billionaire, will complete 12 years as mayor in December. Some New Yorkers, it appears, have had enough. While Mr. de Blasio gives the mayor credit in some areas, he has also been a vocal critic, unlike his competitors.
Polls show that Mr. de Blasio has the backing of more than 40 per cent of eligible Democratic voters ahead of Tuesday's primary. By contrast, Christine Quinn, a municipal leader who worked closely with Mr. Bloomberg and once led the race, now has half that number. Mr. Weiner's campaign, meanwhile, is a walking zombie: The former congressman had the support of just 7 per cent of voters in the most recent survey.
A lanky man with a basketball player's height – six feet, five inches – Mr. de Blasio, 52, is a canny political strategist who directed Hillary Clinton's successful campaign to become a U.S. senator. He favours an additional tax on wealthy New Yorkers to pay for all of the city's children to attend pre-kindergarten. He also wants to increase oversight of the police and pass a ban on racial profiling. If elected, he would be the first mayor in more than 50 years to have a child attending the city's public schools.
Mr. de Blasio "actually has a message that resonates," said Basil Smikle, a Democratic political consultant. Other past mayoral candidates have tried to motivate voters around the notion that New York is increasingly divided by income – a tale of two cities – but Mr. de Blasio has done "the best job of articulating it."
At a recent campaign stop near a Trader Joe's supermarket in Manhattan, Mr. de Blasio had no trouble attracting supporters from among the passing pedestrians. With each voter, he stooped and leaned in to listen.
Mr. de Blasio "represents a lot of what New York has been missing for the last few years," said David Rosenberg, 34, a writer and producer for a children's television channel, after he shook hands with Mr. de Blasio. "It's completely unaffordable to live here. He's the one who speaks to that."
Another critical asset in Mr. de Blasio's campaign: his family. He met his wife, Chirlane McCray, who is African American, when they worked together in City Hall in the early 1990s. At that time, she considered herself a lesbian, a revelation that emerged early in the mayoral campaign. The couple now has two teenaged children who have been enthusiastic campaigners. A recent television commercial featured Mr. de Blasio's 16-year old son, Dante, who wears his hair in a striking Afro. The ad won so many fans that it spawned its own Twitter hashtag (#gowiththefro).
Meanwhile, Mr. Weiner's improbable quest for political redemption is ending with a whimper. A recent string of gaffes – affecting a fake Jamaican accent at a Caribbean parade, getting into a heated argument at a Jewish bakery – received wide attention. It is near certain that he will be eliminated from the race after Tuesday's Democratic primary, something that will come as a relief for most voters.
New York Republicans will also hold a mayoral primary on Tuesday. The frontrunner in that contest is Joseph Lhota, the former chief of the city's public transportation system. But in a city where Democrats outnumber Republicans by a wide margin, the Democratic nomination is the true prize – even if it's no guarantee of victory in November.
The next mayor of New York will face enormous challenges, including renegotiating contracts with city employees and dealing with a yawning budget deficit. Mr. Bloomberg has not yet endorsed a candidate in the mayoral race, but it's clear he will not support Mr. de Blasio. One of Mr. Bloomberg's senior aides has attacked Mr. de Blasio, saying his vision for New York would mark a return to a time when crime was high and the city's finances were precarious. Mr. de Blasio dismissed such criticism as "fear-mongering."
"Bill is in no way a revolutionary," said Douglas Muzzio, a professor of public affairs at the City University of New York. But "he's critical of the whole Bloomberg agenda." The upcoming election, noted Dr. Muzzio, will be "a battle about who's right about the mood of the city."