Tony Blair was warned two months before the invasion of Iraq it would be illegal to go to war without United Nations' authority, the inquiry into the conflict heard today.
A slew of newly declassified Government papers showed Lord Goldsmith, then the attorney general, was initially "pessimistic" that there was sufficient legal basis for military action.
However, after being urged to change his view by the then foreign secretary Jack Straw - who warned against overly "dogmatic" legal advice - he eventually ruled it was lawful.
The inquiry heard how Mr Straw rejected the advice of his senior legal adviser at the Foreign Office, Sir Michael Wood, that an invasion without a UN Security Council resolution specifically authorising military action would be a "crime of aggression".
Sir Michael's deputy Elizabeth Wilmshurst, who resigned in protest on the eve of the invasion in March 2003, described the Government's treatment of the legal advice as "lamentable".
The inquiry also heard that No 10 had raised the prospect of going into Iraq without "international legal authority" for the use of force.
The extent of the concerns among Government lawyers will intensify the pressure on both Lord Goldsmith who gives evidence tomorrow and Mr Blair who appears on Friday.
Even while the negotiations were under way in October 2002 on Security Council resolution 1441 - which required Iraq to give up its supposed weapons of mass destruction - Sir Michael said he was being asked about the consequences of invading without legal authority.
"This was a rather curious request and I am still not entirely sure what the purpose was," he said.
"I think it was to send off to No 10 and it did go to No 10 who said 'Why has this been put in writing?' is my recollection."
Following the passing of 1441 in November 2002, Lord Goldsmith expressed concern to Mr Straw that it was being seen in Government as the legal justification for military action.
A note of a telephone conversation between the two men on November 12 recorded: "The attorney had mentioned the 'Chinese whispers' that had come to his attention in this regard, which suggested that he took an optimistic view of the legal position that would obtain if such a situation arose, whereas he was in fact pessimistic as to whether there would be a sound legal basis in such a situation for the use of force against Iraq."
Lord Goldsmith added that Jonathan Powell, Mr Blair's chief of staff, had indicated that No 10 was "under no illusion" as to his views on the issue.
Initially, Sir Michael said, it was made clear that he should not come down on one side or the other, but in January 2003 he took issue with Mr Straw over his assertion that it would still be possible to take action, even if they failed to get a second resolution authorising war.
"To use force without Security Council authority would amount to a crime of aggression," he wrote in a memorandum to Mr Straw.
Mr Straw replied: "I note your advice but I do not accept it."
Sir Michael told the inquiry: "He took the view that I was being very dogmatic and that international law was pretty vague and that he wasn't used to people taking such a firm position.
"When he had been at the Home Office, he had often been advised things were unlawful but he had gone ahead anyway and won in the courts."
Mr Straw - who is now the Justice Secretary - then took issue with a draft legal opinion which Lord Goldsmith gave to Mr Blair on January 14.
Ms Wilmshurst - who saw a copy - said: "His provisional view was that a second resolution was necessary".
In a letter to Lord Goldsmith dated February 6, Mr Straw however argued for a legal interpretation "which coincides with our firm policy intention".
He added: "I have been very forcefully struck by a paradox in the culture of government lawyers, which is that the less certain the law is, the more certain in their views they become.
"In international law, my experience is of advice which is more dogmatic, even though the range of reasonable interpretations is almost always greater than in respect of domestic law."
On March 7, Lord Goldsmith presented his opinion to Mr Blair in which he argued that a "reasonable case" could be made for legal action under 1441 although it would be safer to have a second resolution.
But with the diplomatic efforts to secure a resolution on the brink of collapse, on March 11 he was called to a meeting with Mr Blair, Mr Straw, defence secretary Geoff Hoon and chief of the defence staff Admiral Lord Boyce.
Two days later, his legal secretary David Brummell noted that he had come to a "better view" that a further resolution was not legally necessary.
In coming to that conclusion, Lord Goldsmith was said to have been "greatly assisted" by discussions he had had with US lawyers he had met in Washington and with Sir Jeremy Greenstock, the British ambassador to the UN.
Ms Wilmshurst - who told the inquiry that the Foreign Office lawyers had been united in their belief of the need for a second resolution - said that by that stage Lord Goldsmith had little choice.
"It was clear that the attorney general was not going to stand in the way of the Government," she said.
"For the attorney to have advised that the conflict would have been unlawful without a second resolution would have been very difficult at that stage, I would have thought handing Saddam Hussein a massive public relations advantage.
"It was extraordinary, frankly, to leave asking him so late in the day. I think the process that was followed in this case was lamentable."
Mr Brummell, however strongly denied any suggestion that Lord Goldsmith had been pressurised into giving the green light for war.
"I wouldn't have said that. It was very much at that time, as I recall, business as usual," he said.Reuse content