LONDON – London's rumpled, comic and outspoken Boris Johnson has won a second term as mayor of the British capital, triumphing in a surprisingly close election that installs the unvarnished and unpredictable Conservative as host of the 2012 Olympics.
Johnson's victory, in election results confirmed late Friday, was a bright spot on a rough day for his colleagues in Prime Minister David Cameron's governing Conservative Party, who took a drubbing in local elections.
Voters stripped both the Conservatives and Liberal Democrats — the junior partner in Britain's coalition government — of hundreds of local authority seats, punishing them for biting austerity measures and Britain's stalled economy.
Known best for his shock of blond hair, and sometimes shocking outbursts, the 47-year-old Johnson narrowly beat out the Labour Party's Ken Livingstone — his predecessor as mayor — for the privilege of leading Britain's capital into the global spotlight when the Summer Games begin on July 27.
In his victory speech, Johnson thanked voters for giving him a "new chance" and promised to continue "fighting for a good deal for Londoners."
Many had expected Johnson to handily defeat Livingstone, a veteran leftist known for his admiration of Venezuela's Hugo Chavez.
But he won by a tighter margin than expected — 51.5 percent to 48.5 percent — and the drama of the race was heightened by delays in counting ballots. The result was announced just minutes before midnight — more than 24 hours after polls had closed.
Johnson's victory could be bittersweet for Cameron — offering relief from his party's national woes, but cementing the outspoken city chief as a likely future leadership rival.
Cameron's Conservatives took a bruising in votes in the 181 local authorities in England, Wales and Scotland which held polls this year, losing more than 400 seats — including some in the leader's own political district.
Although the results won't put Cameron's leadership in jeopardy, they prompted grassroots Conservatives to urge him to ditch some of his more liberal policies, including the planned introduction of same-sex marriage.
Johnson, who has appealed to traditionalists with messages on tax cuts and looser ties to Europe, is increasingly seen as a plausible national leader — not least for bucking for his party's national slump.
"The best thing for Cameron would be to have Boris locked into the London mayoralty for the next four years and out of the way," said Patrick Dunleavy, a political science professor at the London School of Economics.
Cameron also suffered a blow to his legislative hopes, as nine cities — including Manchester, Birmingham and Newscastle-upon-Tyne — voted down plans to have their own directly-elected city mayors.
The leader had hoped that new city chiefs, and U.S.-style elected police commissioners, would help deliver power away from Parliament and into the hands of local communities.
Bristol, in southwestern England, was the only city to vote in favor of electing a new mayor.
Like Cameron, Deputy Prime Minister Nick Clegg's Liberal Democrats — the junior partner in Britain's coalition government — suffered a collapse, losing 336 councilors. That pushed their total number of local councilors below 3,000 for the first time since the party formed in 1988.
Main opposition Labour Party leader Ed Miliband toasted his own party's revival after its ousting from national office in the 2010 national election. It won control of 32 more local authorities and claimed 823 new council seats.
"We are a party winning back people's trust," Miliband said. "People are hurting. People are suffering from this recession, people are suffering from a government that raises taxes for them and cuts taxes for millionaires."
Cameron insisted his poll battering was to be expected at the midpoint before a 2015 national election, and with his government carrying out grueling economic repairs following the global economic crisis.
"These are difficult times and there aren't easy answers," Cameron acknowledged.
Elsewhere, the United Kingdom Independence Party — which advocates a British withdrawal from the European Union — made advances. The far-right British National Party saw its vote wiped out, losing all six council seats it held in the areas contesting elections.
In Scotland, Alex Salmond's separatist Scottish National Party made local gains before an expected 2014 referendum on independence but win control of Glasgow's council, a key target.
Associated Press writer Bob Barr contributed to this story.