Britain's senior military chiefs threatened to resign in protest at defence cuts a year after the Iraq invasion, the inquiry into the war heard today.
General Lord Walker of Aldringham, then head of the armed forces, said the top brass "drew a line" halfway down a list of projects facing the axe and warned Treasury officials to go no further.
He said defence chiefs were not happy with any of the cuts, pointing out that there was a 38% shortfall in helicopter availability at the time.
General Lord Walker also said that military commanders were "anxious" about the legality of the Iraq war until attorney general Lord Goldsmith gave clear advice that it would be lawful.
The inquiry has already heard evidence from former defence secretary Geoff Hoon that the Treasury, under Gordon Brown as chancellor, failed to fund the forces properly in the years before the conflict and then slashed their budget after the invasion.
General Lord Walker said things came to a head in the public spending round in early 2004, when the Treasury gave military chiefs a tough target for budget cuts.
He said: "There was indeed a list of stuff that we were having to make decisions about and I think we drew a line somewhere halfway down the page and said, 'if you go any further than that you will probably have to look for a new set of chiefs'."
The former head of the armed forces confirmed that helicopters were included in the list but were "above the line".
He added: "It makes it sound as though we were happy with what was above the line. We weren't happy with any of it."
The inquiry also heard that ministers were warned of a "serious risk" the military would not have all the equipment it needed to invade Iraq in March 2003 because of the rush to war.
Air Chief Marshal Sir Jock Stirrup, the current head of the armed forces, said: "The problem of course was that we simply didn't have enough time, as it turned out, to do everything we needed to do before the operation started."
He said it would have made a "significant difference" if the military had been given the six months considered necessary to prepare for a large deployment - in the event they had just four months.
Air Chief Marshal Stirrup, who was deputy chief of defence staff (equipment) at the time of the invasion, singled out problems with supplying enough combat body armour, desert combats and boots for frontline troops.
The shortage of body armour was blamed for the death of tank commander Sergeant Steven Roberts, 33, one of the first British soldiers killed in Iraq.
The inquiry has heard evidence that planning for the war was hampered by concerns that public preparations could damage diplomatic negotiations.
Air Chief Marshal Stirrup insisted that defence chiefs voiced their concerns to politicians about the tight time scale.
He said: "We made it absolutely clear to ministers that if we were not allowed to engage with industry - and that was the critical element - we could take these no further and that there was a serious risk that they would not all be delivered by the assumed start of operations."
Air Chief Marshal Stirrup admitted that military chiefs were "very nervous" about overstretching British forces when the Government decided to deploy extra troops to southern Afghanistan in January 2006.
"There was absolutely this concern about the overlap between Iraq and Afghanistan, and the doubt whether we would actually be able to reduce in Iraq quite as quickly as we were planning at that time," he said.
The inquiry also heard that defence chiefs were worried about the legality of the war.
Lord Goldsmith advised on March 7, 2003 that a "reasonable case" could be made for launching an attack without a further United Nations Security Council resolution.
He was then asked by chief of the defence staff Admiral Lord Boyce to come up with a definitive "yes or no" verdict on whether the war would be legal, which he did 10 days later.
General Lord Walker, who was head of the Army when Britain was preparing for the war, said Lord Goldsmith's final advice put military concerns to rest.
He told the inquiry: "Up until we got the letter - it was almost a one-liner - saying we were legal, we were all anxious about it.
"But once we had got that we put our fears aside and got on with it."
Sir Bill Jeffrey, permanent secretary at the MoD since 2005, was due to give evidence today but was taken ill.
The inquiry was adjourned until tomorrow, when it will hear from former international development secretary Clare Short, who resigned in May 2003 over the war.
Shadow defence secretary Liam Fox said: "On the day when Labour ludicrously tried to portray themselves as being the champions of defence, we heard a horror story of the serial hatchet jobs carried out by Gordon Brown on our armed forces during his time as chancellor.
"Sadly, it is our brave service personnel who are still paying the price for his wilful disdain towards our armed forces."
Liberal Democrat defence spokesman Nick Harvey said: "This is yet more evidence that the Government's pursuit of this disastrous war recklessly endangered the lives of our servicemen and women.
"The invasion of Iraq should never have gone ahead. But having done so, the least the Government could have done was ensure that our troops were properly equipped. Instead, they ignored the warnings of military commanders.
"Sir Jock Stirrup's comments demonstrate that Labour irresponsibly overstretched our forces and endangered the mission in Afghanistan by trying to fight in Iraq at the same time."
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies