By Paul Reynolds
BBC News website world affairs correspondent
Iraq haunted Tony Blair.
The Iraq war brought Blair no final success
The intelligence was wrong, the war has been long and the outcome is uncertain. Mr Blair will be leaving office with no date for the troops to be leaving Iraq.
What he and President Bush hoped would be a swift invasion followed by the rapid creation of a stable, representative Iraqi government instead turned into guerrilla and sectarian warfare, in effect a civil war.
There were elections but there was no stability.
And Tony Blair suffered from two major weaknesses in his attempts to justify it.
The first was that the reason given for invasion - the alleged possession by Saddam Hussein of weapons of mass destruction - turned out to be false.
The second is that while the war against the Iraqi army was accomplished quickly, the war against the insurgency was not. The expectation had been that there might be a small but reducing resistance.
Mr Blair could perhaps have lived with one weakness but not two.
Paying the penalty
People might have largely forgotten the missing weapons if the transition to a democratic country had been peacefully achieved.
And if weapons had been found, then the subsequent fighting could have been more easily vindicated.
But he had neither vindication for his reasons to go to war, nor final success in that war.
Supporters will say Blair and Bush did the right thing
And so his reputation, his legacy, has paid the penalty.
He also goes while British troops are heavily engaged in Afghanistan.
This war, against the Taleban trying to make a return to power, has not brought him the public criticism he has suffered over Iraq, perhaps because it is more clearly seen as part of the struggle against militant Islam.
The argument is that if the Taleban returns to Afghanistan, then so too might al-Qaeda.
It is also a battle in which major combat has been joined by countries other than the US and the UK, so the assessment for its need and the responsibility for its implementation is more widely shared than in Iraq.
It was Tony Blair himself who set the high standards by which the invasion of Iraq should be judged.
In a speech of almost apocalyptic proportions in the House of Commons on 18 March 2003, he made comparisons with the Munich crisis of 1938 when Britain and France appeased Hitler.
He spoke of two potential threats converging - dictatorships and terrorists, armed with weapons of mass destruction.
These were the standards he set:
"It will determine the way in which Britain and the world confront the central security threat of the 21st century, the development of the United Nations, the relationship between Europe and the United States, the relations within the European Union and the way in which the United States engages with the rest of the world.
"So it could hardly be more important. It will determine the pattern of international politics for the next generation."
His supporters will say that he and George Bush did the right thing, despite all the troubles, and that the end will one day justify the means.
They believe that a free and democratic Iraq will be a beacon in the Middle East and will also help turn back the Islamic extremist movement, though the unleashing of al-Qaeda-led violence in Iraq proved to be one of the unintended consequences of the invasion.
Iraq is not the only memory of Tony Blair as a war leader. He had greater successes over Kosovo and Sierra Leone and perhaps his successes there led him more easily towards the military option he decided to support over Iraq.
Vietnam overshadowed Lyndon Johnson's domestic achievements
Indeed, Tony Blair seemed to relish the use of military power when he felt that the cause was right.
He was arguing for the use of ground troops to invade Kosovo long before a reluctant President Clinton was ready even to consider them seriously.
In the event they were not needed and American air power alone brought about a Serbian surrender.
Mr Blair felt the cause of the Kosovans - and the cause of a peaceful Europe - required force.
So too did he act in Sierra Leone, sending in British troops for a rapid intervention which turned the tide.
Rush to war
Iraq therefore came after those examples. When it came to Iraq, Mr Blair's natural inclinations were supported by what appeared to him to be good evidence of Saddam Hussein's possession of banned weapons.
He and George Bush saw eye to eye. The result was perhaps inevitable. There was a rush to war.
Tony Blair is not the first Western leader to have the shadow of a war fall across his domestic achievements
The same happened to President Lyndon Johnson. In 1964 he made his "Great Society" speech which heralded the start of a new era in US society. The Civil Rights Act was one of its fruits. So was free medical care for the elderly.
But Lyndon Johnson these days is remembered more for his failure to win the Vietnam war, into which he was pulled as if into a swamp. In the end it destroyed him and he did not stand for president again.
Even a successfully prosecuted war can land a leader in trouble - because of its financial cost. In 1950 Clement Attlee agreed to send British troops to fight in Korea.
Historically, this war is generally seen in the West as justified. It put a marker down against communist expansionism.
But it drained money from the then young National Heath Service and therefore led to divisions within the Labour Party.
Partly as a result, Labour lost the election in 1951.