NEW YORK - Public Advocate Bill de Blasio took a commanding lead over his Democratic opponents in the primary race for New York mayor, but he could still face a runoff election.

De Blasio needs more than 40 percent of voter support to advance to the general election in November against Joe Lhota. The former MTA chairman easily won the Republican nod with 53 percent of the vote over billionaire grocery store magnate John Catsimatidis.

With 97 percent of precincts reporting, de Blasio is still hovering around that 40 percent mark. If he falls below it, he'll trigger an automatic runoff.

Bill Thompson, who is in second place with about 26 percent of the vote, says he will not bow out of the election until he makes sure every vote is counted. There are nearly 19,000 absentee, affidavit and military ballots still yet to be counted.

The board of elections says it will validate the primary day election results from the 5,100 voting machines around the city while counting the absentee ballots by hand. There is a three-week deadline to validate all official votes.

If a runoff occurs, it will be held on Oct. 1.

The primaries also marked the unceremonious end to the bid by City Council Speaker Christine Quinn, who was trying to become the first female and openly gay mayor to run the city.

There will also be no political comebacks for scandal-scarred mayoral candidate Anthony Weiner and former Gov. Eliot Spitzer, who lost the Democratic primary contest for city comptroller to Manhattan Borough President Scott Stringer.