LONDON, England (CNN) -- Conservative Boris Johnson has defeated the ruling Labour Party's two-term mayor of London, election officials announced Friday.
New London Mayor Boris Johnson is one of the nation's best-known lawmakers.
The results cap a miserable election for Labour, which appeared headed for its biggest nationwide council losses in 40 years.
Johnson finished with 1,168,738 votes, compared with 1,028,966 for Ken Livingstone, a liberal known for efforts like brokering oil deals with Venezuela's Hugo Chavez.
Johnson, a former conservative writer and TV commentator and a member of parliament, is one of the nation's best-known lawmakers.
But it's mostly for politically incorrect gaffes that have caused him to issue multiple public apologies.
"I do not for one minute believe that this election shows that London has been transformed overnight into a conservative city," said Johnson, his trademark blond hair a tussled mess moments after results were announced at City Hall.
"But I do hope it does show that the Conservatives have changed into a party that can be trusted again."
Labour lost more than 400 local council seats across England and Wales in Thursday's elections. The conservative Tories gained about 300 seats and control of nine councils.
"It's clear to me that this has been a disappointing night, indeed a bad night, for Labour," said Prime Minister Gordon Brown. "We have lessons to learn from that, and then we'll move forward. My job is to listen and to lead, and that's what I will do."
Labour's share of the national vote was an anemic 24 percent, trailing Britain's Liberal Democrat Party by 1 percentage point. The results were being interpreted Friday as a thumbs-down in the first major election since Brown took over from Tony Blair.
Brown attributed the results, in part, to tough economic times.
"I think people accept that we're going through some of the most challenging times we've seen in many years," he said. "The test of leadership is not what happens in a period of success but what happens in difficult circumstances."
Conservative Party leader David Cameron called the results "a vote of positive confidence in the Conservative Party" but said he and his fellow Tories don't merely want to win based on perceived failures by Brown.
"I want us to really prove to people that we can make the changes they want to see," he said. "That's what I'm going to devote myself and my party to doing over the next four years."
Nicknamed Red Ken for his left-leaning politics, Livingstone, 62, struck a deal with Chavez for subsidized oil to fuel London's buses and used the savings to give half-price fares to people on welfare.
He also introduced a controversial traffic congestion charge: a toll of £8 ($16) for people who drive into central London.
Livingstone recently faced allegations of drinking on the job, which he said is to treat his bronchitis. Watch why personality played a role in the race »
He congratulated Johnson late Friday, telling him "the next few years will be the best years of your life."
"I'll do all I can to help the new administration in any way it seeks," Livingstone said. "But, in whatever role, I'll continue whilst I live and breathe to live in this city, to love this city and to work to make it better."
Johnson, 43, worked for several newspapers, becoming editor of the weekly political magazine The Spectator. He has been a member of parliament since 2001.
Among Johnson's public controversies was accusing the city of Liverpool of "reveling in victimhood" over the death of Ken Bigley, a local man who was taken hostage and killed in Iraq.
He upset others by using racially insensitive terms like "pickaninnies" and "watermelon smiles" in his writing, though he apologized in February for causing offense.
But conservative leader Cameron recently said that "underneath that somewhat disheveled exterior, there is someone with real drive, real passion, real commitment."
Johnson said Livingstone has "earned the thanks and admiration of millions of Londoners, even if you think they have a funny way of showing it today."
He said he'll work to cut crime, improve public transportation, protect London's green spaces and create affordable housing.
"Let's get cracking tomorrow," he said. "Let's have a drink tonight."
CNN's Eileen Hsieh contributed to this report.