By any reckoning, Alistair Darling's announcement yesterday that low-income losers from the abolition of the 10p tax rate will, after all, get backdated compensation, was a stunning climbdown - and nonetheless welcome for that. For the first time since New Labour came to power, the party's core voters have forced a U-turn in government policy of the kind normally reserved for corporate lobbyists. Having lost the argument, and facing meltdown in next week's local elections, the government bowed to political necessity. As Jon Trickett, a leading backbench rebel, put it, this was a "victory for the party's sense of social justice".

But it has also left Gordon Brown floundering before Tory accusations of weakness. Labour is talking up the prospect of a council wipeout next week to discount the impact of what is widely expected to be a dismal performance. But given the fact that these seats were last contested in 2004, when Labour came third with 26% of the vote on the back of hostility to Tony Blair over the Iraq war, the outcome may be less decisive than the spin would suggest.

That will certainly not be the case in London, where the fallout from the mayoral election is likely to be felt in national politics for years to come. Nor is it a contest that can remotely be characterised as a Tweedledum-Tweedledee affair where voters struggle to put a cigarette paper between the candidates. For all Ken Livingstone's accommodations with the City of London and Boris Johnson's jokes and floppy hair, the dividing lines could not be clearer. This is a battle between a veteran radical who has used his powers to redistribute, to protect the environment and help make London one of the most successful multicultural cities in the world, and a Thatcherite privateer and opponent of the Kyoto treaty who backed the Iraq war and has managed to alienate almost every one of the ethnic minorities who make up 40% of the capital's population.

Perhaps it's no surprise, then, that this election has also been the focus of the most poisonous media onslaught for almost two decades. The relentless attacks on the mayor by London's only paid-for newspaper, the Evening Standard, which has in effect run Boris Johnson's campaign throughout, have turned election rules on their head with character assassination ads displayed on an almost daily basis on newsstands across the city. Genuine investigations into cronyism or development grants have long since lapsed into smears, reaching a new low last week with the mendacious "Suicide bomb backer runs Ken campaign" banner headline.

The fact that the Standard and its parent company, Associated Newspapers, have an interest in the renewal of the contract for the exclusive distribution of their Metro freesheet on the London Underground next year can only reinforce the paper's long-established ideological hostility to Livingstone and everything he stands for. The flipside is that the Tory challenger is given the gentlest of media rides. Johnson is, after all, a candidate who underestimated the cost of his plan to build a new generation of Routemaster buses by a factor of 12, who wants to reprivatise the tube but isn't quite sure how, and whose minders' main concern is to keep his pronouncements to a bare minimum, in particular about who would be running City Hall if he were elected.

Even more alarmingly, this is a man who struggles to apologise for calling black people "piccaninnies" or for insisting after the 2005 London bomb attacks that "the problem is Islam", the "most viciously sectarian of all religions", and that Islamophobia seems a "natural reaction". It's scarcely surprising that the British National party has called for its supporters' second preference votes to go to Johnson, which the latter's disavowals will do nothing to restrain. The prospect of such a figure uniting London in the event of another 7/7 beggars belief.

Nevertheless, the intensity of the media assault, Labour's national unpopularity and the fact that Livingstone has been in office for eight years combined to put the mayor on the back foot early on and trailing in the polls. And while the not-so-liberal Lib Dem candidate Brian Paddick has evidently tilted towards Johnson, Livingstone's initial irascibility and over-egged efforts to project a statesmanlike image helped undermine a crucial part of his appeal.

With most polls now showing the two main candidates neck and neck, that is clearly changing. Meeting community activists in a church hall in Herne Hill, south London this week, Livingstone was visibly relaxing into his more popular persona. Sitting next to the Blairite minister for the Olympics Tessa Jowell, he cheerfully described the private train operating companies as "rapacious thieving criminals" and the management of the Post Office as a "dodgy couple" who were "only interested in the bottom line". "Well, there you are," Jowell responded awkwardly.

Livingstone's track record of leadership and competence is without doubt an essential weapon against Johnson's lack of experience and breathtaking inability to master a brief. But the mayor also needs to distance himself from Brown and remind voters of his continuing radical edge if he is to mobilise his strongest support among young, ethnic minority and women voters: from his return of privatised tube lines to public hands, to the extension of free transport to the under-18s and over-60s, to the requirement that 50% of all new housing be affordable, to the imposition of a £7.20 an hour living wage, to the new £25 congestion charge on gas guzzlers - along with multibillion-pound investment plans for transport, housing and training. To underscore his commitment to the coalition behind him, now stretching from Jowell to George Galloway, Livingstone yesterday committed himself to appointing Greens and Lib Dems to his administration.

The implications of next week's London contest for national politics are obvious. If Livingstone is ousted, it will be a dramatic blow to Labour's attempts to pull itself out of its tailspin and an emblematic boost to David Cameron's efforts to put the Tories in a commanding electoral lead. But if London's mayor were to win a third term, it would be a powerful springboard for the growing challenge to the government's warmed-up Blairism - and an unanswerable demonstration that there are alternative routes to electoral success.