New York City Democratic mayoral hopeful Bill de Blasio embraces his son Dante, left, daughter Chiara, second from left, and wife Chirlane McCray, right, at his election headquarters after polls closed in the city's primary election Tuesday, Sept. 10, 2013.

NEW YORK — As the New York mayoral election turns the bend toward its final stretch run to the Nov. 5 general election, an explosive set of themes have begun to emerge: race and class warfare.

A little over a month ago, few might have predicted such a volatile contrast between the candidates who won this Tuesday’s primary.

But the dramatic and unexpected victory of Public Advocate Bill de Blasio, the most liberal of the primary candidates, has turned the general election into a highly-charged debate about the Democrat’s relentless focus on the economic divisions within the city, as well as his front-and-center use of his biracial family in the campaign. (A fraction of votes remain to be tallied before he is likely declared the party’s official nominee.)

Mr. de Blasio, who put together a startlingly broad-based coalition of the city’s diverse patchwork of Democrats, has illustrated his policies with an effective use of a Dickensian reference to “a tale of two cities” – a not-so-subtle reference to the famous novel about French peasants and aristocrats, which ends at the guillotine.

His opponent, Republican Joe Lhota, the former city transportation chief, called de Blasio’s campaign slogan “nothing more than class warfare – an attempt to divide the city” during his victory speech Tuesday night.

And on Thursday, his first day campaigning as the official Republican nominee, Mr. Lhota again lashed out at de Blasio’s campaign leitmotif.

“Calling it a tale of two cities, that level of invective has no place in any campaign, at all,” he said at one of his stops. “It divides people. What we really need to do is to work together and provide a solution, not separating people and then saying that the ends justify the means.”

Outgoing Mayor Michael Bloomberg, the main target of de Blasio’s withering attacks during the primary, also suggested last week that de Blasio’s campaign was rooted in class warfare, adding it was racist, too. Mr. Bloomberg was careful, however, to say he was not calling de Blasio himself a racist. The Democratic candidate, who is white, is married to the black writer and political activist Chirlane McCray.

Still, the mayor’s comments were widely criticized, and Lhota, too, distanced himself from Bloomberg’s comments. During Sunday’s Republican debate, he said, "I don't think Bill de Blasio is running a racially motivated campaign. However, I have said I do believe he's running a campaign based on class warfare.”

Most observers pinpoint the moment the de Blasio phenomenon took off: when it released a 30-second commercial, featuring the candidate’s son, Dante, who wears his hair in a striking Afro style.

He coyly listed the candidate’s policy positions, telling viewers Bill de Blasio was the only one with “the guts to break from the Bloomberg years,” including raising taxes on the rich to fund education and ending the “stop-and-frisk era that unfairly targets people of color.” At the end of the commercial, Dante finally reveals the candidate is his dad.

“In one week at the beginning of August, Bill de Blasio came from far behind to being the frontrunner in this race, by coming out with one good TV ad that simultaneously introduced him, introduced his values, and introduced the issues that he was going to run on,” says Bart Robbett, president of the Greater NYC Chapter of the American Association of Political Consultants.

Yet, apart from the current public advocate’s striking multicultural family, racially-charged issues have played a large role in the Democratic primary – and Democrats comprise six of seven registered voters in this city with more than 8 million residents.

“As much as Lhota may prefer to avoid the issue of race in this election, it is unlikely he'll be able to do that,” e-mails Jeanne Zaino, professor of political campaign management at the New York University School of Continuing and Professional Studies. “This is due in part to the type of campaign de Blasio is likely to run, but also to outside factors, such as the stop, question and frisk and Trayvon Martin cases.”

But the Lhota campaign is already actively courting support and funding from the city’s wealthy Wall Street class, some of whom have described the prospect of a Mayor de Blasio “terrifying.” Many believe Lhota is the only hope to continue the business-friendly policies of the Bloomberg administration.

“In terms of broader themes, I think we will get not just a referendum on the Bloomberg era, but a referendum on the Dinkins era as well,” e-mails Ms. Zaino, referring to former Mayor David Dinkins.

Indeed, Lhota has been rhetorically asking whether voters really want to go back to the time during the tenure of the city’s only black mayor – when de Blasio began his career in politics as a volunteer coordinator and aide in City Hall.

“In contrast, De Blasio will continue to critique the Bloomberg era and ask whether voters want to move forward with the New York City of [former mayor Rudy] Giuliani and Bloomberg,” e-mails Zaino.