Republican billionaire Michael Bloomberg won an unlikely victory in New York's mayoral race Tuesday, lining him up to take over the city's recovery from the devastating World Trade Center attack.

"New York is alive and well and open for business!" Bloomberg shouted to cheering supporters. "We are clearly going to have enormous problems but I know we are up to the task."

The 59-year-old media mogul spent a record $50 million to defeat liberal Democrat Mark Green.

"Tonight is not about Republicans or Democrats. It's about New Yorkers," Bloomberg said. "This is our victory, a victory for our vision and our faith in the future of the greatest city in the world."

Bloomberg, who founded the financial empire that bears his name, has never held public office. Common Cause said the amount of money he spent made the race the most expensive mayoral campaign in U.S. history.

Green conceded early Wednesday after a seesaw battle through the night. According to the city Board of Elections, with 99 percent of the votes counted in the nine-candidate race, Bloomberg had 711,189 to Green's 670,413.

"We gave it our all and it wasn't enough," Green said. "I ask the city to support him."

Bloomberg, who won in a city where Democrats outnumber Republicans 5-to-1, will succeed Republican Rudolph Giuliani, the popular incumbent who cannot seek a third term. The mayor, who led chants of "USA, USA!" as Bloomberg gave his victory speech, briefly flirted with the idea of somehow staying in office past Dec. 31.

Bloomberg will inherit a city that has been in crisis since Sept. 11, when the World Trade Center was felled by two hijacked jets.

An estimated 100,000 jobs have been lost due to the resulting downturn in the economy, and the next mayor will have to bridge a multibillion-dollar budget gap.

"We suffered a terrible tragedy on Sept. 11 and we are just not going to let the terrorists beat us," Bloomberg said.

Green, the city's public advocate and a lifelong consumer activist, was hurt by a poor showing among Hispanic voters, who split their vote between the two men rather than favoring the Democrat as they have in past mayoral races.

Green's standing among Hispanics was damaged by an ongoing feud with Fernando Ferrer, the Bronx borough president who lost to Green in a Democratic primary runoff last month.

Green spent just $12 million on his campaign, partially because of limits on his spending in the primary under the city's campaign finance law.

Bloomberg tried to portray himself as the natural successor to Giuliani, citing his success in the private sector as good experience for running the cash-strapped city.

Green argued that his own experience in city government — including a stint as consumer affairs commissioner — and his resume as an activist on issues ranging from police brutality to domestic violence made him more qualified.

But exit polls showed Green was hurt by Democrats who defected to Bloomberg.

"The economy is very important now and a business background is really what's needed here," said Ruth Levine, a retired secretary who voted for Bloomberg even though she is a Democrat.

Just two weeks ago, polls showed Green with a 16-point lead over Bloomberg, but they entered the final hours of the campaign in a dead heat with angry accusations on both sides.

The day before the election, Green portrayed Bloomberg as a "rich elitist," attacked his past membership in four all-white clubs and ran ads detailing a sexual harassment lawsuit filed by a woman who once worked for Bloomberg. The lawsuit was settled for an undisclosed sum with the woman agreeing not to make any public comment.

Bloomberg, meanwhile, questioned the Green campaign's alleged role in distributing racially tinged material the day before the runoff against Ferrer. Green denied his campaign was responsible, but his support among Hispanics was damaged by the incident.

The Associated Press contributed to this report.