Public Advocate Bill de Blasio, who ran an upstart campaign pledging to fight New York City's economic inequality, emerged as the surprising top choice in the Democratic mayoral primary, but could still face weeks _ and another electoral fight _ before becoming his party's nominee. 
 
 Mayoral candidate Bill de Blasio, right, kisses his wife Chirlane McCray after casting his primary vote on Tuesday, Sept. 10, 2013, at the Park Slope Public Library in Brooklyn, N.Y. New Yorkers head... (Associated Press) 
 
 Democratic mayoral hopeful Anthony Weiner holds his son Jordan as he leaves the voting booth after casting his vote at his polling station during the primary election in New York, Tuesday, Sept. 10, 2013.... (Associated Press) 
 
 City Council Speaker and New York City Democratic mayoral hopeful Christine Quinn, right, embraces her wife, Kim Catullo, after Catullo voted in the primary election, Tuesday, Sept. 10, 2013, in New York.... (Associated Press) 
 
 The swirling, chaotic campaign to replace billionaire Mayor Michael Bloomberg, which featured former congressman Anthony Weiner's latest sexting scandal and at least three lead changes in the polls, was fittingly plunged into uncertainty again after the votes were tallied in Tuesday's primary. 
 
 With 97 percent of precincts reporting, de Blasio had about 40.2 percent of the total vote, which puts him a whisker above the 40 percent threshold needed to avoid triggering an automatic Oct. 1 runoff. If he cannot maintain that, he will face former city Comptroller Bill Thompson, who has 26 percent, for a potentially grueling three-week, one-on-one showdown, with the winner advancing to face Republican nominee Joe Lhota, the former chairman of the Metropolitan Transit Authority, in the general election on Nov. 5. 
 
 But it may take a week or more before it is known whether that battle will be fought at all. 
 
 The campaign will take a pause Wednesday as the city stops to observe the anniversary of the Sept. 11, 2001, terrorist attacks. Later this week, election officials will recount all the ballots cast Tuesday. It will likely take until early next week before they tabulate an additional 30,000 or more votes as absentee ballots arrive by mail and paperwork comes in from voters who had problems at the polls. 
 
 City Council Speaker Christine Quinn, the early front-runner who was seeking to become the city's first woman and openly gay mayor, finished third at 16 percent, followed by current city Comptroller John Liu at 7 percent and Weiner at 5 percent. 
 
 De Blasio, who was flanked by the interracial family he made a centerpiece of his campaign ads, made no mention of the potential runoff in his speech to supporters late Tuesday. 
 
 "We are better as a city when we make sure that everyone has a shot," de Blasio told the raucous crowd. "We begin tonight." 
 
 The winner of the mayor's race in November will assume the helm of the nation's largest city which has been led for 12 years by Bloomberg. The election comes at a critical juncture as the city experiences shrinking crime rates yet widening income inequality, and as the nearly completed One World Trade Center building symbolizes a new era after the terrorist attacks of 2001. 
 
 With de Blasio so close to 40 percent, Democratic leaders may pressure Thompson to drop out of the race in the name of party unity. Exit polling shows that de Blasio would handily defeat Thompson in a runoff, 52 to 34 percent, with 9 percent saying they would stay home. 
 
 But Thompson made it clear Tuesday he would compete in a potential runoff. 
 
 "Three more weeks! Three more weeks!" chanted Thompson, the party's 2009 nominee. "This is far from over." 
 
 De Blasio's rise in the race to succeed Bloomberg was as sudden as it was unexpected. 
 
 Not even two months ago, he was an afterthought in the campaign but surged in part thanks to an ad blitz that centered on his interracial family, his headline-grabbing arrest while protesting the possible closure of a Brooklyn hospital and the defection of Weiner's former supporters in the wake of another sexting scandal. 
 
 Weiner was leading in the polls until a gossip website revealed that he used the online handle Carlos Danger to continue to send X-rated messages to women even after he resigned from the House of Representatives in 2011 for similar behavior. 
 
 The exit polling showed the appeal of de Blasio, the city's elected public advocate, to be broad-based: He was ahead in all five boroughs; was ahead of Quinn, the lone woman in the race, with female voters; and ahead of Thompson, the only African-American candidate, with black voters. The voter interviews were conducted by Edison Media Research for The Associated Press and other news organizations. 
 
 Lhota, the ex-transit authority chairman and former deputy mayor to Rudolph Giuliani, defeated billionaire grocery magnate John Catsimatidis for the Republican nomination. Both Republican candidates largely pledged to follow Bloomberg's lead, focusing on maintaining the city's record low crime rates. 
 
 Another scandal-scarred politician, Eliot Spitzer, who resigned as New York's governor in 2008 after paying for sex with prostitutes, tried to run a self-financed campaign for the lesser office of city comptroller. But his distant, television-heavy campaign struggled to connect with voters and he lost to Manhattan Borough President Scott Stringer by a margin of 52 percent to 48 percent. 
 
 Bloomberg, the businessman Republican-turned-independent, is completing his third term. While the city's registered Democrats outnumber Republicans 6 to 1, the Republican Party's recent success in mayoral elections has been largely attributed to a crime epidemic, the aftermath of the Sept. 11 attacks or other extraordinary circumstances. 
 
 Nearly three-quarters of Democratic primary voters said the next mayor ought to move away from Bloomberg policies, according to the exit polls. 
 
 De Blasio, 52, has fashioned himself as the cleanest break from the Bloomberg years, proposing to raise taxes on the wealthy to fund universal pre-kindergarten and change city police practices he says discriminate against minorities. 
 
 De Blasio, who worked in Bill Clinton's White House and Hillary Rodham Clinton's Senate campaign before being elected to the city council and then public advocate, became the front-runner in the race's final weeks. 
 
 Quinn was the front-runner for much of the year, boasting the biggest campaign war chest and strong establishment backing. But she was dogged by her support to change term limits to let Bloomberg run again in 2009, a decision unpopular with liberals who make up the bulk of Democratic primary voters. ||||| Nation's largest city holds primary as Mayor Michael Bloomberg's tenure nears an end. 
 
 New York City Democratic Mayoral hopeful Bill De Blasio embraces his son Dante, left, daughter Chiara, second from left, and wife Chirlane, right, after addressing supporters at his election headquarters after polls closed in the city's primary election. (Photo: Kathy Willens, AP) Story Highlights Public advocate had double-digit lead over William Thompson for Democratic nomination 
 
 40% was needed to advance to Nov. 5 election vs. Republican Joe Lhota 
 
 Voters reject Weiner, Spitzer bids for redemption 
 
 Bill de Blasio was the clear leader in the Democratic race for New York City mayor early Wednesday, teetering near the 40% mark he needed to advance to the general election against Republican Joe Lhota without a runoff. 
 
 William Thompson, de Blasio's closest rival and the 2009 Democratic nominee for mayor, refused to concede until the last vote is counted. 
 
 The Associated Press reported that it may take a week or more before de Blasio emerges as his party's nominee. 
 
 STORY: 'Tabloid Twins' Weiner, Spitzer lose comeback bids 
 
 The only sure thing about the first round of balloting in New York City was that voters rejected Anthony Weiner and Eliot Spitzer, who were seeking redemption after sex scandals derailed their once-promising careers. 
 
 Voters also turned back City Council Speaker Christine Quinn's historic bid to be the city's first female and first openly gay mayor, and relegated the one-time front-runner to third place behind de Blasio and Thompson. 
 
 As he thanked his supporters in Brooklyn, de Blasio sounded confident and outlined his vision for the nation's most populous city. Standing beside him were his wife, Chirlane McCray, daughter Chiara and son Dante, who became a mini-celebrity after his starring role in a much-talked about campaign ad for his dad. 
 
 "Our mission is to change our city in the name of progress," de Blasio said, as his supporters chanted, "Mayor Bill." 
 
 He promised to end the striking economic imbalance that has widened the gap between rich and poor in New York City. "The tale of two cities will be in our past," de Blasio vowed. 
 
 Christine Quinn and Anthony Weiner at one time led polls for the Democratic nomination for New York City mayor. (Photo: James Keivom, AP) 
 
 STORY: NYC moves past raucous primary 
 
 In one of the main subplots of the primary election, former congressman Weiner and ex-governor Spitzer have had their comeback bids shot down by voters. Weiner finished a distant fifth among the major Democratic mayoral hopefuls. Spitzer was defeated by Manhattan Borough President Scott Stringer in a close race to be the Democratic nominee for city comptroller. 
 
 Weiner briefly led public opinion polls in the mayor's race. His support dwindled after he admitted he continued to send salacious messages to women through the Internet — even after his sexting habit forced him to resign from Congress in 2011. Spitzer, who resigned as governor in 2008 after admitting he paid for sex with prostitutes, also briefly led the comptroller's race. 
 
 "We had the best ideas," Weiner told his supporters. "Sadly, I was an imperfect messenger." 
 
 Democrats have a 6-to-1 voter registration advantage over Republicans, meaning the Democratic nominee will be heavily favored to succeed Mayor Michael Bloomberg. Despite the city's political tilt, a Democrat hasn't been elected mayor since David Dinkins defeated Ed Koch in 1989. 
 
 Tuesday's primary was the first since 1997 without Bloomberg, an independent, on the ballot but he still loomed large in the race. 
 
 Quinn took shots for supporting Bloomberg on overturning the city's term limits law, which allowed him to seek and win a third term. De Blasio, meanwhile, said he was the candidate who could "offer an unapologetic progressive alternative to the Bloomberg era." 
 
 De Blasio "peaked at the right time," said Lee Miringoff, director of the Marist Institute for Public Opinion. 
 
 In the comptroller's race, Stringer will face Republican John Burnett in the fall. Burnett is a longtime wealth manager at Wall Street firms. 
 
 Turnout was light among the city's 3.2 million registered Democrats and 510,000 Republicans. Some voters reported problems with the city's old voting machines, including jams and breakdowns of levers, causing some people to have to write down their election choices on a piece of paper. 
 
 Contributing: Martha T. Moore; the Associated Press 
 
 Follow @ccamia on Twitter. 
 
 Read or Share this story: http://usat.ly/1fSkGzd
– As expected, Bill de Blasio will easily finish first in New York City's Democratic primary for mayor, reports the AP. What's unclear is whether he will get the necessary 40% to avoid a runoff with the second-place finisher. With 97% of returns in, de Blasio had 40.02%, Bill Thompson 26%, and Christine Quinn 15%. Trailing those three were city comptroller John Liu (7%) and, yes, Anthony Weiner (5%). The eventual Democratic winner will face former MTA chief (and Rudy Giuliani deputy) Joe Lhota in the general election in November. He won the GOP race over billionaire John Catsimatidis. There will be a recount of yesterday's ballots, and some 30,000 votes, including absentee ballots, still need to be counted a first time. A final result may not be known for 10 days and Thompson has made it clear that he won't drop out in the name of party unity: He chanted "Three more weeks!" at his election night event, referring to a time before a potential runoff, which polls show he would lose. Exit polls showed that de Blasio, the city's public advocate, did well with a wide swath of voters from different ethnic groups and locales, reports the New York Times. More so than the other candidates, he advocated a clean break from Michael Bloomberg, making a particular issue of Bloomberg's stop-and-frisk policy. The mayor interjected himself into the campaign when he accused de Blasio of running a "racist" campaign—in part because the candidate featured his Afro-sporting teen son in a TV ad. De Blasio is white, his wife is black, and he would be first city mayor with an interracial family, notes the Times.