London mayor Boris Johnson 'to work his socks off'
Boris Johnson has said he will "work his socks off" as he was sworn in for his second term as London mayor.
Conservative Mr Johnson beat Labour rival Ken Livingstone by 3%, after a far closer contest than expected.
"I want to thank the people of London for giving me a second mandate," Mr Johnson said.
Mr Livingstone said: "I will spend the rest of my life regretting we didn't win this one because it would have made a lot of difference to people's lives."
He added: "I'm really sad. For me personally, I'm now retired. I can spend more time with the kids, walk the dog, keep on gardening.
"But there was so much we could have done to help Londoners get through this."
Mr Johnson signed the Declaration of Acceptance of Office before giving a short speech at City Hall.
He said: "I promise everybody in this city, that I and my team will work our socks off to deliver on our vision and our programme for London."
He said his victory had given him the mandate for "to go forward with automation of Tube network" and to "keep police numbers high in London and to keep crime coming down".
The mayor added that he would "stand up for London and Londoners" to get "real value for London for the Olympic Games".
London 2012 - One extraordinary year
"We now have 83 days left, my friends, to get the greatest city in the world ready to host the greatest Olympic and Paralympic Games that have ever been held.
"Can we do it? Do you think we can get it ready? I think we can."
Mr Johnson won on second preference votes after failing to gain more than 50% in the first round.
He bucked the national trend after heavy Tory losses elsewhere.
Liberal Democrat Brian Paddick saw his vote collapse and he was beaten into fourth place by Green Jenny Jones, with independent Siobhan Benita fifth.Continue reading the main story
London Mayor council results
Mr Johnson gained 44% of first preference votes, to Mr Livingstone's 40.3%.
After second preferences came into play, Mr Johnson gained a total of 1,054,811 votes, or 51.5%, to the Labour candidate's 48.5% - making it an even closer contest than in 2008.
Mr Livingstone appeared to announce his retirement from frontline politics in his losing speech, saying "this will be my last election".
He apologised for failing to secure victory, but said the campaign had been "vicious and unpleasant" and blamed "incredibly slanted" media coverage which he said had led to his key pledge - to cut fares - being "marginalised".
Labour's London-wide Assembly vote was up 14.3% on 2008, while the Conservatives were down 4.7%.
The 38.1% turnout in London was down 6.7% on 2008 when Mr Johnson and Mr Livingstone last went head to head in the race for City Hall.
To cap a dreadful night at the polls for the Liberal Democrats, Mr Paddick lost more than half of his 2008 vote.
He said: "We ran an honest campaign based on Liberal Democrat principles and now, more than ever, is a time Liberal Democrats have to stand up for what we believe in."
Ms Benita, a political newcomer, was the surprise package of the night, threatening at one point to come third ahead of Mr Paddick and the Greens' Ms Jones.
The independent candidate has told the BBC she plans to stand again in 2016, claiming that people are "disillusioned with party politics" and want "a new type of public leader".
Ms Jones described her third-place finish as a "wonderful day for Green politics".
She said: "It's happened in many other places, in many other countries, but this is a first for Britain and definitely for London and I'm very happy that our messages have resonated."
· All the latest election results are available at bbc.co.uk/vote2012