Fernando Ferrer, the former Bronx borough president, stood alone as the Democratic challenger to Mayor Michael R. Bloomberg after Rep. Anthony D. Weiner surprised supporters by conceding the primary.

After Tuesday's primary, Ferrer had finished a whisker short of the 40 percent needed to avoid a runoff election with Weiner, and supporters of both candidates beat hard on the war drums election night.

But Weiner, a skinny, fast-talking quipster whose campaign roared down the stretch, awoke Wednesday morning and decided that there was little percentage in continuing. A count of 25,000 absentee ballots might well hand victory to Ferrer. And the ritual bloodletting to which city Democrats are prone all but guaranteed that the victor would limp onto the field against Bloomberg.

"Our differences are relatively small in comparison to our differences with Republican Mike Bloomberg," Weiner said at a hastily convened news conference in front of his old family home in Brooklyn's Park Slope neighborhood. "We need to be unified against a man who demonstrated that he will spend any amount of money to win."

That man, Bloomberg, is a billionaire media mogul who spent $70 million on his 2001 campaign (slightly less than most candidates spend running for president) and he has served notice he is ready to toss many more bales of cash into the fire this time around. Political strategists say the prospects for Ferrer, who could become the city's first mayor of Puerto Rican descent, are not terribly encouraging.

Bloomberg, who can project a CEO's disdain for the symbols and ceremonies of politics, has rebounded from low poll numbers of 2002 and now rides well ahead of Ferrer. The city's economy is no longer reeling as it was in 2001. And Bloomberg, if rarely loved, is regarded by many residents as an able manager.

"Bloomberg made a lot of amateur mistakes early on and his personality is not great and sometimes he can't help himself," said Douglas Muzzio, a political scientist at Baruch College in New York City. "But he's a smart guy and he's matured."

Befitting a man who spent his formative years in the Wall Street pit, Bloomberg plays a mean game of political hardball. His strategy is to hone in on his opponents' every weakness, and reinforce the point with a daily barrage of television commercials. On Wednesday, the mayor staged a sort of plutocrats' pep rally, unveiling a Democrats for Bloomberg list that included financiers Steven Rattner and Felix Rohatyn, and film producer Harvey Weinstein.

Ferrer, meanwhile, began raising money and sharpening attacks on Bloomberg as a Bush-supporting Republican who is out of touch with New Yorkers (Bloomberg is, in fact, a lifelong Democrat who switched party affiliations to capture the Republican nomination in 2001. The mayor is pro-choice and anti-death penalty, though he has donated tens of thousands of dollars to Republican candidates).

As for Weiner, he caught a few bouquets. Few Democrats looked forward to a replay of the ethnic and racial tensions that erupted during the party's last runoff -- four years ago, when Ferrer lost to consumer advocate Mark Green, who like Weiner is white and Jewish. Nothing so prompts admiration as a politician who manages to seamlessly marry selflessness and self-interest, and the chatter Wednesday was that Weiner is a formidable contender for the 2009 nomination.

"He was edgier than the other candidates and he had a sense of humor," Muzzio said. "And Weiner proved that he could think outside the box, right down the last move."

New York mayoral candidate Fernando Ferrer, second from left, advanced to the general election when Anthony D. Weiner, third from left, conceded. The other Democratic candidates, shown at a debate on Tuesday, are C. Virginia Fields and Gifford Miller.