Christine Quinn and Anthony Weiner at one time led polls for the Democratic nomination for New York City mayor. / James Keivom, AP

by Catalina Camia, USA TODAY

by Catalina Camia, USA TODAY

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.

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.

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.