Britain's most senior military officer at the time of the invasion of Iraq told the Chilcot inquiry he repeatedly asked Tony Blair for an assurance that the war would be lawful and was emphatically assured the aim was never "regime change".

In striking contrast to previous evidence about the former prime minister's war aims, Admiral Lord Boyce said : "Our policy absolutely and specifically was not regime change".

Blair's closest advisers, including Sir David Manning have told the inquiry that the former prime minister assured President George Bush he was willing to undertake regime change. Lord Turnbull, cabinet secretary at the time, described Blair as a "regime changer".

Boyce made clear he was deeply concerned about the legality of an invasion. Lord Goldsmith had warned more than once that regime change was "not a legal basis for military action".

Boyce told the inquiry today: " I made it clear to the prime minister in January 2003 (once we had started to deploy our forces), that I would require an assurance of the legal base of the conflict. This was reiterated more than once in the following weeks, and formally and explicitly in March, once it became clear that it was probable that coalition forces would invade once political approval was obtained".

Boyce also said Blair failed to deliver on his promises to provide the military with all the resources they needed for the war.

He described the attitude of the Treasury as an "impediment" to the mission in Iraq, while the government as a whole had lacked "cohesion" in dealing with the issue.

"I suspect if I asked half the cabinet were we at war, they would not have known what I was talking about. There was a lack of political cohesion at the top", Boyce told the inquiry.

Blair repeatedly gave assurances that the armed forces would have everything they needed, the inquiry heard.

Boyce said: "I know he says that but actually getting it delivered is quite a different matter altogether. Particularly on the money side. 'Don't worry, you can have everything you want. Go and see the chancellor.' Brick wall there ... Getting money out of the Treasury is like getting blood out of a stone anyway. The Treasury is inherently unable to deliver money unless it is actually beaten over the head".

The inquiry released a one-sentence extract from minutes of a chiefs of staff meeting on 19 March 2003, the day of the invasion, saying that just 3% of gas masks for British troops had been checked. Boyce questioned the figure.