As the votes were counted in mayoral races across the country, the biggest shock of the night occurred in a race that turned out just as everyone had expected: Michael Bloomberg won a third term as mayor of New York City, but by a surprisingly small margin.

In winning a fifth term, Boston Mayor Thomas Menino also survived a tougher challenge than he'd grown used to. But in the end, Menino won handily, taking 57 percent of the vote.

Several other incumbents won easily, including the mayors of Buffalo, Detroit, Cincinnati, Cleveland, Pittsburgh, Minneapolis and St. Paul. But yesterday's results will lead to runoffs in Houston and Atlanta, and several new mayors will be taking office in Florida and Ohio.

Providing one of the few bright spots of the night for his party, Democratic Councilman Anthony Foxx narrowly won the Charlotte, N.C., mayor's race -- the first time Democrats have prevailed there in 22 years. Incumbent Republican Pat McCrory is stepping down after seven terms.

In Seattle, where Mayor Greg Nickles had been unseated in the primary, attorney and environmentalist Mike McGinn held a slender lead over cell phone executive Joe Mallahan, but the outcome may not be known for days.

In New York, Bloomberg, running as a Republican and an Independent, defeated City Comptroller William Thompson, who had received tepid support, at best, from fellow Democrats. Given his personal fortune and high-profile initiatives, Bloomberg had been considered unbeatable. But Bloomberg carried just over 50 percent of the vote.

Congressman Anthony Weiner, a Democrat who had considered running for the office, told the New York Times that voters were angered by Bloomberg's bid for a third term, which had been made possible by a city council vote lifting term limits.

The race cost Bloomberg an estimated $90 million. In his three races, Bloomberg has spent more of his personal fortune on campaigns than any candidate in U.S. history. Now, Bloomberg and the city face a $5 billion budget deficit.

In another election that turned on anti-incumbency sentiment, Tomás Regalado beat fellow city commissioner Joe Sanchez by a 3-to-1 margin to replace outgoing Miami Mayor Manny Diaz. Sanchez had been a Diaz ally, while Regalado had voted against nearly all the mayor's major projects and initiatives, suggesting that voters were displeased with the city's rapid development and subsequent real estate bust.

Across the state in St. Petersburg, Republican Bill Foster found a different path to victory against Kathy Ford. Foster had served on the city council for most the tenure of outgoing Mayor Rick Baker and pledged to continue in his footsteps, promising only tweaks to the city budget and public safety programs.

In the Atlanta mayor's race, Councilwoman Mary Norwood led as votes were counted throughout the night, but her final total of 45 percent fell short of the majority needed to avoid a runoff. She'll face Kasim Reed, a former state legislator outgoing Mayor Shirley Franklin had endorsed a day before the election.

Norwood would be the city's first white mayor since 1973. Racial politics have played a prominent role in other mayoral runoffs in recent Atlanta history.

Houston also will see a runoff, which will feature an unexpected pair of finalists. City Controller Annise Parker and former City Attorney Gene Locke had been expected to compete for second place, but instead they turned out to be the two top finishers.

City Councilman Peter Brown had led in polls and spent $3 million in family money to build up an advertising advantage, but to no avail. He finished third. If elected, Parker would be the first openly gay mayor of a top-10 U.S. city.

Toledo's long-time fire chief Mike Bell, running as an independent, prevailed in his race to succeed controversial Mayor Carty Finkbeiner. In Dayton, political newcomer Gary Leitzell upset Mayor Rhine McLin, who was seeking a third term.