Democrat Fernando Ferrer (search) has enough votes to officially win the mayoral primary and will face Republican Michael Bloomberg (search) on Nov. 8, election officials said Monday.

After a week of uncertainty, Ferrer was just past the 40 percent mark needed to avoid a runoff after election workers finished counting absentee and other untallied votes over the weekend. Board of Election officials spoke on condition of anonymity until the official announcement was made Monday afternoon.

The second-place finisher, U.S. Rep. Anthony Weiner (search), already conceded the contest to Ferrer, but the question of a runoff had loomed over the race for days as the Board of Elections furiously worked to count thousands of paper ballots.

Cheers rang out at Ferrer campaign headquarters as staff members heard the news, and Ferrer spokeswoman Jen Bluestein said the candidate is "grateful for the support of New Yorkers who made him their definitive choice to return Democratic values to City Hall."

Democrats had feared a runoff could nip the momentum, exposure and fund-raising Ferrer, the former Bronx borough president, would get as the uncontested nominee. Two Democratic lawyers filed a lawsuit Friday to block the runoff, calling it a waste of taxpayers' money after Weiner conceded but saying they acted independent of the party.

Of the 2.6 million registered Democrats in New York City, just 456,463 cast votes for one of four Democratic candidates in the primary.

Bloomberg campaign spokesman Stu Loeser said Monday that the numbers meant that "93 percent of registered Democrats in New York City did not vote for Freddy last week."

He added that those voters are "already proving very receptive to the record Mike Bloomberg's leadership has produced." Bloomberg, a Democrat until he changed parties when he entered politics, is enjoying wide popularity as he seeks his second term.

When unofficial returns were tallied after last Tuesday's vote, Ferrer had been a fraction of a point away from the 40 percent threshold. But a new and more precise analysis by The Associated Press found Friday that he finished with 40.048 percent. That tally did not include the additional absentee ballots counted in recent days by the elections board.