By Peter Griffiths and Tim Castle
LONDON (Reuters) - Boris Johnson dodged a humiliating nationwide defeat for Prime Minister David Cameron by winning London in local elections that saw voters angry at Britain's economic woes flock to opposition Labour and a right-wing anti-European fringe party.
Maverick mayor Johnson's silver-lining win in London was the only good news for Cameron whom local media said had been given a bloody nose by voters upset at spending cuts and Britain's return to recession.
Even Johnson, who as one of the most popular politicians in Cameron's own party is tipped as a possible future prime minister, saw his majority slashed, claiming victory only after a lengthy count that had put him head to head with his rival, Labour candidate Ken Livingstone.
"I will continue to fight for a good deal for Londoners, a good deal from the government that will help us deliver prosperity for everybody in this city," Johnson, famous for his ruffled fair hair, said after the vote count at London's City Hall, a rounded glass building on the Thames.
Johnson failed to mention the wider Conservative defeat, but his challenger, Livingstone, said that the victory could put Johnson on course to one day lead the Conservative party.
With results declared in all 181 councils being contested across the country, Labour had gained 823 new councilors while the Conservatives had lost 405 and their Liberal Democrat coalition partners were down by 336.
After preaching economic prudence, Cameron's coalition government was damaged by a return to recession and weeks of blunders that made ministers appear out of touch with voters struggling with high unemployment, price rises and low wages.
Cameron apologized to Conservative candidates who lost their jobs, blaming the defeat on the tough decisions he had been forced to make to reduce Britain's debt mountain and mend the $2.5 trillion economy.
"There aren't easy answers," said Cameron, whose party lost seats to Labour in the rural constituency he represents in parliament.
'WAKE UP CALL'
Labour said the results were a wake-up call for the government to soften its flagship deficit-cutting agenda.
"People are hurting, people are suffering from the recession, people are suffering from a government that has raised taxes for them and cut taxes for millionaires," said Ed Miliband, leader of centre-left Labour.
For Miliband, who has been under constant fire since he took over the Labour Party in 2010, the vote was a rare victory - with the exception of London - though he was pelted with an egg during a celebratory walk through Southampton.
The government's drubbing increased pressure on Cameron from within his own party to shift his electoral strategy to the right, a step Cameron's supporters say would be electoral suicide and sour his relations with his coalition partners, the centre-left Liberal Democrats.
"David Cameron is fighting to run a government with one hand tied behind his back because we are attached to wishy-washy Liberals and of course what Liberals are good for is opposition but they are absolutely useless in government," Conservative lawmaker Peter Bone told the BBC.
"ARROGANT POSH BOYS"
Derided as "arrogant posh boys who don't know the price of milk" by a Conservative rebel, Cameron and his finance minister George Osborne have struggled with a view that they are out of touch. This was reinforced by a row about the so-called "pasty tax", a sales-tax rise that pushed up the price of pasties, a cheap and popular snack.
Foreign Secretary William Hague sought to play down the scale of the Conservatives' defeat, saying it was "perfectly common" for governments to suffer losses at mid-term local elections. A national vote will be held in 2015.
UKIP, which stands for UK Independence Party, was contesting only a fraction of the total seats up for grabs but where it did field candidates, it averaged a record 14 percent of the vote.
This translated into just nine councilors because UKIP's support is geographically scattered, which makes it hard for the party to win any individual ward.
However, UKIP's surge was a clear threat to the Conservatives, who need to increase their popular support before the next national election.
"What they're scared of is that this trickle of support that has come to UKIP could turn into a flood," UKIP leader Nigel Farage told Reuters on Friday.
Philip Davies, a Conservative member of parliament, told Reuters there was no doubt that UKIP was taking votes from the Conservatives and that it was "a massive threat".
"They will undoubtedly stop us from winning seats that we would otherwise win (in 2015), and given how difficult it is for us to win an overall majority, every seat counts," he said.
At the last national parliamentary election, in 2010, the Conservatives fell short of an overall majority even though Labour were unpopular after 13 years in power. Cameron was forced to form an uneasy coalition with the Liberal Democrats.
"A MACHINE THAT'S NOT WORKING"
Vociferous right-wingers within the Conservative Party have always maintained that Cameron should have done more to appeal to the party's traditional supporters by attacking the European Union and talking tough on crime and immigration.
"So far he's tended to treat his party like a general, a field-marshal. But he has to realize it's not his party and listen to other voices in the party," influential online Conservative activist Tim Montgomerie told Reuters.
"Until he shows he's an electoral success, he won't command loyalty. The Conservative Party is an election-winning machine and right now it's a machine that's not working."
Cameron's cherished policy of strengthening local democracy by introducing elected mayors also suffered a setback. Voters in eight cities voted against having a directly elected mayor, with only Bristol voting in favor.
The picture was equally bleak for the Liberal Democrats, whose support has collapsed since they went into government. The local election results in England were the worst in their history.
In one area of Edinburgh, the Liberal Democrats won fewer votes than a climate activist wearing a penguin suit calling himself Professor Pongoo.
Labour, which had struggled to capitalize on the coalition's problems, captured 38 percent of the national vote versus 31 percent for the Conservatives and 16 percent for the Lib Dems. Voters turnout was low at just 32 percent.
(Additional reporting by Matt Falloon, Mohammed Abbas, Adrian Croft, and Estelle Shirbon; Writing by Guy Faulconbridge and Estelle Shirbon; Editing by Angus MacSwan)