By Paul Reynolds
World Affairs correspondent, BBC News website
The resignation of the US Defence Secretary Donald Rumsfeld shows how much the Bush administration is in disarray about Iraq.
The president made it quite clear at a news conference after the election that he had decided beforehand that a "fresh perspective" was needed at the Pentagon.
This means that, win or lose the election, Mr Bush had decided that things were going badly enough to remove one of the architects of the war.
In fact, when Mr Bush told reporters last week that Mr Rumsfeld would be staying on, he had already spoken to Mr Rumsfeld about leaving.
On Wednesday, Mr Bush told reporters he had decided ahead of the elections that "win or lose, Bob Gates was going to become the nominee".
Whether Robert Gates, a former CIA director, is the kind of man to provide much of a fresh perspective remains to be seen. Until now he has always been an establishment figure. But he seems to be about to become one of the pegs on which new hopes will be hung.
The departure of Donald Rumsfeld is a major moment in the history of the Bush administration and the war in Iraq.
His resignation is a sign and an admission that the policy in Iraq has not worked, so far.
Apart from Vice-President Dick Cheney and President Bush himself, there was nobody who more clearly symbolised the administration's determination to wage the war on terror and to get rid of Saddam Hussein.
"We know they have weapons of mass destruction," he announced of the Iraqis at one stage. "We don't need any debate about it." His confidence and brusque dismissal of dissent was typical. For some, it amounted to arrogance.
Rumsfeld brought to the Pentagon years of ambition to stir up a department he had run as a much younger man under President Ford.
The recent book about the administration at war by Washington Post reporter Bob Woodward, State of Denial, tells of the blizzard of handwritten memos known as "snowflakes" with which he bombarded his officials.
He was determined to break what he saw as the old guard and to get control of policy himself, which he felt was too much in the hands of the generals and admirals.
He wanted a slimmer, more mobile military, one more capable of waging war on international terrorists and governments that supported them and less concentrated on the massive weapons systems that were being developed as if the Cold War had not ended.
Donald Rumsfeld felt himself to be the right man, in the right place, at the right time.
His direct, irascible, sometimes even folksy style appealed to many when things were going well. His famous dictum about there being "known unknowns" and "unknown unknowns", made pre-Iraq, was seen as quirky and "Rummy" at his most idiosyncratic.
In a resignation appearance with President Bush and his own successor in the Oval Office, Mr Rumsfeld referred, almost as if he had not been appreciated, to "this little understood, unfamiliar war, the first war of the 21st century... It is not well known, it was not well understood, it is complex for people to comprehend."
However, the very confidence that allowed him to make his mark on the Pentagon also led to his downfall - it became overconfidence.
He ignored warnings that his reliance on hard-hitting, relatively small units would win the ground war in Iraq but would not win a guerrilla war.
Like most US policymakers, he simply did not believe that Iraqis would not welcome the invaders and take care of events for themselves from then on.
He was not a man of patience and did not in the end have the necessary patience for a long, drawn out counter insurgency war. Nor did he show the flexibility of tactics needed to demonstrate to his commander-in-chief that he was going to deliver the victory the president believes is so necessary.
He had to go, whatever the results of the elections.