It may have been a bad night at the end of a difficult week for Tony Blair, but the prime minister will allow himself at least a tiny sigh of relief at Labour's by-election results.
By Nick Assinder
BBC News Online political correspondent
Because, despite seeing massive slides in the government's standing in both Birmingham and Leicester, it could have been worse.
To lose Leicester South to the Liberal Democrats is a severe blow, but to hold on to Birmingham Hodge Hill at this stage in a parliament will have taken the edge off it.
It may only have been by the slimmest of margins, and it would be extremely rash of the Labour party not to take a serious message from the result.
But it was not the absolute nightmare some had been fearing.
The best news for Labour is that the Tories did so badly
And by far the best news for Labour is the fact that the Tories did so badly, being forced into third place in both polls.
That is extremely bad news for Michael Howard and will throw the first serious doubt over his leadership.
Few believe the Tories will see it as terminal, however, and in the immediate aftermath of the polls, senior party figures were putting a brave face on it.
And, as usual, all three parties had very different takes on the results.
For the Tories, the polls were all about Tony Blair - his leadership, his trustworthiness and his future.
For Labour the results were all about Michael Howard and his inability to show the Tories were the real opposition threat.
And for the Liberal Democrats, the outcome was all about them and their claim they are becoming the real opposition to New Labour.
And this probably was the Lib Dem's night and, coming on the heels of recent poll results, will put a further spring in leader Charles Kennedy's step.
He has long wanted to be able to claim that his party is now the 'real opposition' and these results will give him the chance to push that message.
He may not have pulled off a sensational double victory and even he will know there is always the chance the tide will turn again come the general election.
That is what has tended to happen with previous Lib Dem by-election victories, but there is no law that states history has to repeat itself.
And recent polls for local councils and the European parliament show that voters are far more volatile than for decades and have become used to voting differently in different elections.
The Tories will be hugely disappointed that they have failed to make the sort of advances they need to prove they really are on the way back in time for the looming general election.
The results suggest that the anti-Labour vote went to the Lib Dems rather than the Tories and Mr Howard knows he still has a major battle ahead to persuade disillusioned voters to look to him as an alternative to New Labour.
And, while Tony Blair avoided the worst, there were deeply worrying signs for him that voters are looking for that alternative.
The polls may, to some extent, have been about local issues such as law and order. But the shadow of the war on Iraq hung over the proceedings.
And the Butler report, which was published on the eve of the poll, served to whip up the controversy over the prime minister's actions in taking Britain into that conflict.
And the whole issue of Iraq has become a wider symbol for the whole issue of trust and credibility.
And there is plenty of evidence - particularly from the showing by the anti-war Respect party - that Mr Blair still has much to fear in that area.
But it seems the darkest predictions that his leadership would be under serious threat after these polls, and in the wake of Butler, may prove wide of the mark.