With more than 97 percent of precincts reporting as of early Wednesday morning, Democrat Bill de Blasio is flirting with the 40 percent mark necessary to avoid a runoff in the Democratic mayoral primary, while Joseph Lhota celebrates his victory on the GOP side.
As of 5:20 a.m., with nearly 98 percent of precincts reporting, de Blasio had 40.19 percent of the Democratic vote, leading William Thompson's 26 percent and Christine Quinn's 16 percent.
The winner of that primary needs 40 percent of the vote to avoid a runoff.
"We know there's a long road ahead," De Blasio, the city's public advocate, told a cheering crowd of supporters at around midnight, as returns showed him teetering on the verge of winning the primary outright over second-place finisher William Thompson. "That's true for this campaign, but also in the job that we're seeking to do."
Counting the ballots could take several days. The Board of Elections will open the machines on Friday. Officials will start counting paper ballots on Monday.
Meanwhile, Lhota will advance to November's general election after capturing 52 percent of the vote to John Catsimatidis' 41 percent.
"Now is the time for our party to come together and unite for the common good," the former MTA chairman and one-time deputy mayor told supporters after defeating Catsimatidis, the owner of the Gristedes grocery chain. "This is the first step towards continuing a strong future for our city."
Catsimatidis, meanwhile, sounded downtrodden in defeat.
"I wanted to come through not just for myself, but for all of you," he told supporters. "I want to apologize to my staff that I didn't do better, that I didn't win this thing for all of you. Next time, I'll work harder."
In the Democratic city comptroller race, Manhattan Borough President Scott Stringer defeated Eliot Spitzer, 52 percent to 48 percent, ending the former governor's attempt at a political comeback.
Meanwhile, there will be a runoff in the Democratic primary for public advocate between state Senator Daniel Squadron and City Councilwoman Letitia James.
With more than 96 percent of precincts reporting, James had 36 percent of the vote and Squadron had 33 percent, over former Deputy Public Advocate Reshma Saujani, college professor Cathy Guerriero and the NYPD's Sidique Wai.
In another closely-watched race, Brooklyn District Attorney Charles Hynes was upset by challenger Ken Thompson. Hynes, who has served as Brooklyn DA since 1990, received 45 percent of the vote to Thompson's 55 percent.
Tuesday's results helped determine who will vie for the city's top offices in November's general election, including the race to succeed Michael Bloomberg following his 12 years as mayor.
The race for mayor is William Thompson's second run for mayor after the former school board president narrowly lost to Bloomberg in 2009's general election.
"Tonight is for everyone out there who's ever been counted out, for everyone who's been told their dreams are too big," Thompson told supporters late Tuesday night. "We are just getting going here."
Tuesday's results could spell an uncertain future for Quinn, the outgoing City Council Speaker who was the mayoral front-runner until the very late stages of the campaign, when she fell behind both de Blasio and Thompson.
"I want to congratulate my opponents on a hard-earned victory," she told supporters in her concession speech. "While we disagree on some issues, we all care deeply about this city. I wish both of them the best of luck."
After serving as a councilmember for seven years, Quinn rose to City Council speaker in 2006. In 2008, she helped overturn a term-limits law that allowed Bloomberg to win a third term as mayor, a move that drew attacks from her opponents throughout the campaign.
Also facing uncertainty is former Rep. Anthony Weiner, who placed a distant fifth in the Democratic mayoral primary with 5 percent of the vote.
Weiner, who resigned his congressional post in 2011 in the wake of a lewd texting scandal, leaped to the front of many polls when he joined the mayoral race in June. But he nosedived a month later after it was revealed that he continued to exchange lewd messages with women in the months following his resignation.
"I have to say, ladies and gentlemen, we had the best ideas," he told supporters in his concession speech. "Sadly, I was an imperfect messenger."
The former seven-term congressman was defiant till the end.
"We will continue the fight," he said, his voice choked with emotion, as he left the stage.
Also finishing in the pack was City Comptroller John Liu, who placed fourth with 7 percent of the vote. A city councilmember from Queens starting in 2001, he was elected comptroller in 2009, and ran by many accounts the most energetic campaign of any mayoral candidate. But his campaign treasurer and a former fundraiser were found guilty in May of organizing straw donor schemes, and Liu was subsequently denied public matching funds by the Campaign Finance Board.
"We have been thrown many obstacles and challenges along the way," Liu told his supporters Tuesday night. "But with every one of these challenges, we have always risen to the task. We showed what fortitude is about, because we never strayed from our ideals and principles."
Pastor Erick Salgado finished sixth with 2 percent of the vote, while former City Councilman Sal Albanese was last with less than one percent.
De Blasio voted Tuesday at the Park Slope Public Library in Brooklyn, joined by his wife Chirlane. Thompson cast his vote at the Young Diplomats Magnet Academy on West 122nd Street in Harlem. Quinn cast her ballot along with her wife Kim Catullo at Chelsea Prep on Ninth Avenue and 26th Street, while Liu cast his ballot in the Whitestone section of Queens.
Weiner hit the polls early in Manhattan, bringing his son Jordan out to Baruch College. His name was missing from the rolls at the polling site, but the situation was eventually cleared up and he was able to vote.
Lhota voted at the Congregation Mount Sinai Church in Brooklyn.
Due to a problem with voting machines, the former MTA chairman had to submit his ballot on paper.
Catsimatidis cast his vote on the Upper East Side, dropping by his polling site on East 60th Street along with his wife Margo and their children.
Meanwhile, what's old was new again for voters Tuesday.
The old lever voting machines were brought out of retirement for the primary.
They were retired nearly four years ago when the city turned to an electronic scanning method. But with the possibility of a runoff in a few weeks, election officials were concerned there wouldn't be enough time to reprogram the electronic machines.
Legislators in Albany agreed, allowing the lever machines to return.
The electronic scanners will be used for the general election on November 5.