Ken Livingstone has beaten Oona King to the Labour nomination for London mayor, setting him up for a political rematch in the capital with his old rival Boris Johnson in 2012.

The result, announced today in central London, officially brings Livingstone back to the political fold after two years of campaigning in the wings.

Livingstone polled 68.6% of the votes, with King, the former MP for Bethnal Green and Bow, on 31.4%.

Accepting the nomination, Livingstone made it clear that he would campaign on an anti-government ticket. He said the 2012 mayoral vote, seen as the best barometer of public opinion before the 2015 general election, would be an opportunity for voters to voice their opposition to the coalition's public spending cuts.

He said: "We will unite Londoners around a message to [David] Cameron and [George] Osborne that we don't want these cuts. If you want to get them out, you start by getting out Boris Johnson."

Johnson ended Livingstone's eight-year reign as London mayor in 2008, and the Conservative mayor will stand for re-election in two years' time.

Livingstone also promised to hold down transport fares in London. "Fares will always be lower than if Boris Johnson is re-elected in 2012," he said, adding that the money to keep fares low would come from reinstating the western extension to the congestion charge.

Labour's two-horse race for the nomination was decided by an electoral college made up of London's 35,000 party members and 38 London MPs, and the 400,000 voters belonging to the 14 unions and organisations affiliated to the London Labour party.

Livingstone, 65, will address the Labour party conference in Manchester next Wednesday.

A poll conducted by three London media organisations this week showed 9% of Londoners would prefer King as their next mayor, with Livingstone on 27% and Johnson on 45%.

Livingstone has blamed his 2008 defeat to Johnson on the Labour party's standing at the time, following its worst set of election results in 40 years. He also blamed the London Evening Standard newspaper, which ran a hostile campaign against him in advance of the poll.

During two years in the political wilderness, Livingstone shrugged off commentators who suggested he needed to "move on".

The 2012 election will be the first election held under a Tory-led administration since the mayoralty began under Livingstone in 2000.

Johnson declared earlier this month his intention to stand for a second four-year term, and has so far declined to comment on the prospect of a rematch with Livingstone, although he seemed resigned to the idea that the "old war horse" would be selected.

Livingstone has urged Londoners to "punish" Johnson for the spending cuts being introduced by the coalition government. He has promised to use "every lever available" to "protect Londoners from the cuts" and has railed against Johnson's plans to cut 445 police officers in the capital.