He never had run for public office. Before announcing his candidacy for mayor in this overwhelmingly Democratic city, he jumped parties and became a Republican. To his opponents' delight, his utterances on the campaign trail could veer close to the comical.

Yet, the odds-defying approach that turned Michael R. Bloomberg into a financial-news magnate and one of the wealthiest men in New York resulted this week in a hair's-breadth victory in the race to succeed Rudolph Giuliani as mayor. Bloomberg beat Democrat Mark Green by a mere 43,000 votes out of the nearly 1.4 million cast Tuesday.

The question now is whether the blunt decisiveness that served the self-described "Wall Street star" so well in business will help or hinder him as he leads the city in tackling the twin challenges of rebuilding lower Manhattan and stanching the economic hemorrhage that began with the Sept. 11 terrorist attacks.

In the last two months, New York has lost an estimated 100,000 jobs as companies slash payrolls or move away from areas feared vulnerable. The city budget is projected to show a $1.2 billion deficit this year and a $4 billion shortfall next year.

"His challenges are greater than what LaGuardia had, or what I had," said former mayor Ed Koch, referring to Depression-era mayor Fiorello LaGuardia. "What he will do is bring all the talents that he had in the private sector, as an entrepreneur, and hopefully he will do for us what he did for himself: He took $10 million and converted it into $4 billion."

Koch, a Democrat, endorsed Bloomberg shortly before the election.

The task is a daunting job for a political neophyte who will have to erase lingering doubts that his candidacy was little more than a rich man's fancy. Bloomberg, 59, spent a record $50 million of his fortune on his campaign, mainly to pay for an onslaught of television ads.

But the obstacles Bloomberg faces as the next mayor would seem the ultimate fulfillment of a lifelong desire to test his own limits. Among his recreational pursuits, he is an avid skier and a helicopter pilot.

"Happiness for me is a thrill of the unknown, trying something that everyone says can't be done, feeling that gnawing feeling in my stomach that says, `Danger ahead,'" Bloomberg wrote in his 1997 autobiography, "Bloomberg by Bloomberg."

The unlikely triumph of Michael Rubens Bloomberg is the story of a dairy accountant's son who became a financial-news king, philanthropist and New York socialite.

Born and raised in working-class Medford, Mass., Bloomberg was a class president at Johns Hopkins University, graduating in 1964 with an engineering degree. He earned a degree in 1966 from Harvard Business School and took a $9,000-a-year job as a clerk at Salomon Brothers on Wall Street.

Rising through the ranks of the equities desk, he lapped up Wall Street's hard and fast life.

"As a bachelor who traveled with a big expense account, I had a girlfriend in every city, skied every resort, ate in every four-star restaurant and never missed a Broadway play," he recalled in his autobiography.

Bloomberg was a partner at Salomon by 1973 but fell out with the firm's leadership. He was forced out in 1981 with a $10 million send-off package and used the money to found the company now known as Bloomberg LP.

The firm, then a one-room operation that aimed to provide financial news to businesses through custom-made computers, grew to include radio, television and publishing arms, 7,800 employees, and an estimated $2.5 billion in annual sales. Forbes estimated Bloomberg's personal wealth at $4 billion, making him the sixth-richest man in New York.

In preparation for his mayoral bid, Bloomberg stepped back from day-to-day operations in June but kept a 72 percent share of the firm. He has said he will await guidance from the city's Conflict of Interests Board as to whether he should place the holdings in a blind trust.

Lavish philanthropy

Great wealth gave the bookkeeper's son entree into the city's most exclusive social circles, and his philanthropic gifts yielded membership on some of Manhattan's choicest cultural boards, including the Lincoln Center and the Metropolitan Museum of Art, where he has contributed millions for such things as a sophisticated audio guide that museum-goers can program to suit their interests. As a result of another gift, the museum's arms and armor hall is named for his daughters, Emma and Georgina.

"He's a decision-maker. He's a positive thinker," said Emily Rafferty, who oversees the museum's fundraising efforts and deals frequently with Bloomberg. "He's always looking at the glass as half full."

Perhaps the greatest beneficiary of his largess has been his alma mater, Johns Hopkins, to which he has donated at least $100 million. The university's school of public health is named for him, as is a physics and astronomy building. A professorial chair in the art history department is named for his mother, who at 92 still lives in the family house and whom he says he calls every morning.

Since 1996, Bloomberg has been the chairman of the university's board of trustees. University President William R. Brody believes that the experience will help Bloomberg in his new job because it has forced him to deal with a world where he is not the boss. As mayor, Bloomberg will face a similar challenge in dealing with city unions and an often recalcitrant City Council.

"Although he's blunt and quick, he delegates well," Brody said. "He doesn't micromanage. He doesn't go around people. I think that Mike recognizes that running a city is different from running a business."

And different, perhaps, from running a campaign. The brash streak that helped him in business produced some startling moments after he defied convention and announced his candidacy with a television spot, setting a pattern that continued to Election Day.

One day early in the race, he asserted that sanitation workers face greater danger than police or firefighters. On the day Gov. George Pataki, a conservative Republican, stood beside Bloomberg to announce his endorsement, the candidate answered a reporter's question about his political beliefs by declaring himself a liberal.

Giuliani's backing helps

The endorsement that really mattered to New Yorkers was the blessing from Giuliani, who featured heavily in Bloomberg's ads in the waning days of the race. Bloomberg quickly closed the gap in public opinion polls to draw even with Green by Tuesday.

Since his victory, Bloomberg has gone out of his way to court support from the city's Hispanic and black Democratic leaders, a gesture that wins points with Rev. Al Sharpton, one of Giuliani's most vocal critics. Bloomberg has said he wants to meet with Sharpton, something Giuliani has never done.

"He has already done more than his predecessor," Sharpton said. "He has reached out. All of us realize there are going to be some sacrifices that are going to have to be made. If he listens, and if he gives people a fair hearing, they can't distrust his motives even if they disagree with him."