EXCEPT for the overabundance of flags run up by the prime minister across Whitehall last week - they were white for St George not for surrender - you wouldn't know that the capital, and the country, stand on the edge of a political precipice.

Both Gordon Brown and David Cameron will be waiting on the result of this Thursday's London mayoral election with bated breath. It is their first electoral test as leaders and the outcome could decide their fate as much as it settles the future of bendy buses on London's streets.

The latest opinion poll gives Labour's Ken Livingstone a narrow lead on 41% with the Conservative Boris Johnson three points behind. With the second preference votes distributed, Livingstone is due to win under this forecast, but with a slew of other polls reading the election the other way it's time for psephologists to consult the real experts - the betting shops.

Right now the odds favour Johnson, the Billy Bunter caricature turned presidential material by a highly disciplined campaign team. Johnson, who hasn't been allowed to open his mouth to put his habitual foot into it for the past six months, has been rewarded with electoral credibility. He's taken the Tory campaign from nowhere and now he is 8-15 on to win. My gambling friend explains this means you would get £8 back for every £15 you put on. As a low-stake punter you might feel short-changed but it sounds just about right when it comes to the deal London would probably get from Johnson.

Livingstone, who has a commendable eight-year record of managing multi-million pound budgets and projecting London as the best city on the planet, has been on the back foot. For the first time in his life he is the establishment incumbent . He's also been under relentless attack by the Evening Standard, London's only paid-for daily newspaper, and been criticised from the left by a phalanx of London's left-liberal commentariat, splintering the alliance of minorities from which he draws so much electoral strength. Over the next few days he can expect an all out assault from the Standard although they do seem to have thrown everything except the newt bowl at him over the past few weeks.

Surviving depends on a pact with the Green party candidate, Sian Berry, holding up. Livingstone, who hasn't lost an election since he entered politics in the 1970s, needs a lot of political luck this time and it's beginning to look as if Tony Blair used up all of Labour's share of good fortune over the past decade.

Livingstone began the campaign looking tired and irritable but remarkably in the past few days he seems to have found some of the old chippy, cheeky Ken that Londoners loved from his days as leader of the Greater London Council and when he took office in 2000 as an independent because the Labour leadership wouldn't back him.

The Labour leadership has been pretty lukewarm with its support this time too, although that dynamic duo, Blair and Campbell, are said to have been lending a hand. The countdown - which will see Labour warning that Johnson is a bad joke and a risk that London can't afford - has the hallmarks of a New Labour campaign that worked, for a while, in Scottish elections.

Friday will be a long tense day similar, I expect, to the morning after last year's Scottish election, when we spent sleep-deprived hours calculating and re-calculating just who was going to win.

Everyone agrees Livingstone will be ahead to begin with as the boxes from the inner London boroughs are counted first. But as the results come in from the leafy suburbs the pendulum is expected to swing towards the mighty blond one. Johnson has spent a lot of his time and his £1 million campaign budget on the outer boroughs and in galvanising his core vote.

The result will depend not just on those second preference votes that are distributed to the top two candidates, but also on the ability of the two main parties to get their core vote out. After the 10p tax rate fiasco and depleted by the Iraq war, Livingstone, who is a divisive figure in the Labour party, fears there simply aren't enough activists left in the branches to get the vote out.

Into the vacuum created by the Labour party step the far-right, who play on legitimate fears about immigration, housing and cultural identity to push forward a darker agenda. The BNP is close to making a breakthrough onto the London Assembly and would be helped greatly by a low turnout.

There is a school of thought that Cameron's favoured outcome is for Johnson to come a close second because a win would put the reality of a Conservative government under very close scrutiny in a high risk and high profile way, and that conversely, Brown is secretly hoping that Johnson will win.

I don't buy that theory, particularly with Brown under such an electoral storm and many in the Labour party predicting losses of more than 200 seats in the English and Welsh elections on the same day.

The sky won't fall in on London late on Friday afternoon if Johnson does win, but there will be a particularly dark cloud over Downing Street.

Having an English establishment clown as London mayor - even if he has to be straight-jacketed and gagged in a dark room for two years - will make the idea of an Old Etonian running the country, as well as the capital, seem quite normal.