Documents about how the legal case for the Iraq war was formulated by the Blair government seven years ago were made public yesterday, revealing the grave doubts of the Attorney General over impending military action.

The drafts of legal advice and letters sent to the Prime Minister by Lord Goldsmith had been kept secret despite repeated calls for them to be published. Yesterday they were released by the Chilcot Inquiry into the war, after the head of the Civil Service, Sir Gus O'Donnell, stated that the "long-standing convention" for such documents to be kept confidential had to be waived because the issue of the legality of the Iraq war had a "unique status".

It had been known that Lord Goldsmith had initially advised the government that an attack on Iraq would not be legal without a fresh United Nations resolution. However, just before the US-led invasion he presented a new set of opinions saying that a new resolution was not needed after all.

Tony Blair appeared to show his irritation with the warnings over military actions, saying in a handwritten note: "I just do not understand this." In another note, a Downing Street aide said: "We do not need further advice on this matter."

In the documents released yesterday, Lord Goldsmith repeatedly stated that an invasion without a fresh UN resolution would be illegal, and warned against using Saddam Hussein's supposed WMD (weapons of mass destruction) as a reason for attack. Two months later, in autumn 2002, Downing Street published a dossier that stressed the alleged WMD threat in an attempt to boost public support for war.

In a letter to Mr Blair on 30 July 2002, marked "Secret and Strictly personal – UK Eyes only", Lord Goldsmith stated: "In the absence of a fresh resolution by the Security Council which would at least involve a new determination of a material and flagrant breach [by Iraq] military action would be unlawful. Even if there were such a resolution, but one which did not explicitly authorise the use of force, it would remain highly debatable whether it legitimised military action – but without it the position is, in my view, clear."

In his letter, copied to the then Foreign Secretary, Jack Straw, and Defence Secretary Geoff Hoon, the Attorney General warned that any form of military assistance offered to the US, however limited, such as "the use of UK bases, the provision of logistical or other support ... would all engage the UK's responsibility under international law. We would therefore need to be satisfied in all cases as to the legality of the use of force."

Lord Goldsmith continued: "The development of WMD is not in itself sufficient to indicate such imminence. On the basis of the material which I have been shown ... there would not be any grounds for regarding an Iraqi use of WMD as imminent."

Successive inquiries into the Iraq war, by Lord Hutton, Lord Butler and now Sir John Chilcot, have heard repeated claims that Lord Goldsmith was subsequently persuaded to change his advice into the legality of military action by Mr Blair and members of his government.

In January 2003 Mr Blair met President Bush at the White House. The Prime Minister's foreign policy adviser, Sir David Manning, wrote a memo paraphrasing Mr Bush's comments at the meeting as: "The start date for the military campaign was now pencilled for 10th March. This was when the bombing would begin."

In a letter to Mr Blair dated 30 January 2003, after the UN had passed another resolution on Iraq, 1441, Lord Goldsmith wrote: "In view of your meeting with President Bush on Friday, I thought you might wish to know whether a further decision of the Security Council is legally required in order to authorise the use of force against Iraq." The letter marked "secret" continued: "I remain of the view that the correct legal interpretation of Resolution 1441 is that it does not authorise the use of military force without a further determination by the Security Council." Lord Goldsmith concluded: "I have not copied this minute further."

The Attorney General sent a draft advice to Mr Blair dated 12 February 2003 after he had consulted US officials. He said: "It is clear that Resolution 1441 does not expressly authorise the use of force. It follows that resolution may only be relied on as providing the legal basis for military action if it has the effect of reviving the authorisation to use force contained in Resolution 678 (1990)" – when Iraq was adjudged by the UN to have flouted previous resolutions.

But the Attorney General stressed "it is clear that the [Security] Council did not intend the authorisation in Resolution 678 should revive immediately following the adoption of Resolution 1441." He continued: "The language of 1441 is not clear and the statements made on adoption of the resolution suggests there were differences of views within the Council. The safest legal course would be to secure the adoption of the further Council decision." Lord Goldsmith continued: "If action were to be taken without a further Security Council decision, particularly if the UK had tried to and failed to secure the adoption of a second resolution, I would expect the Government to be accused of acting unlawfully."

The Attorney General was told to provide clarification of his advice by the Government and the final version was delivered to Cabinet on 7 March 2003, days before the invasion. Lord Goldsmith had decided a new resolution was not needed, after all, to justify war.

* Tony Blair was named winner of the prestigious Liberty Medal last night by America's National Constitution Centre for "his steadfast commitment to conflict resolution" in Northern Ireland and the Middle East.

Legal advice: What Attorney General said before the Blair-Bush summit...

30.07.02: Goldsmith's advice to the Prime Minister

"The key issue here is whether an attack is imminent. The development of WMD is not in itself sufficient to indicate such imminence. On the basis of the material which I have been shown – and I appreciate that there may be other documentation which I have not seen – there would not be any grounds for regarding an Iraqi use of WMD as imminent.

"My view therefore is that in the absence of a fresh resolution by the Security Council which would at least involve a new determination of a material and flagrant breach, military action would be unlawful. Even if there were such a resolution, but one which did not explicitly authorise the use of force, it would remain highly debatable whether it legitimised military action – but without it the position is, in my view, clear."

14.01.03: Attorney General's advice to the PM, after Resolution 1441 is passed by the UN

"It is clear that Resolution 1441 contains no express authorisation by the Security Council for the use of force.

"However, the authorisation to use force contained in Resolution 678 (1990) may revive where the Security Council has stated that there has been a breach of the ceasefire conditions imposed on Iraq by Resolution 687 (1991).

"But the revival argument will not be defensible if the Council has made it clear either that action short of the use of force should be taken to ensure compliance with the terms of the ceasefire. In conclusion therefore, my opinion is that Resolution 1441 does not revive the authorisation to use of force contained in Resolution 678 in the absence of a further decision of the Security Council."

18.10.02: Record of Attorney General's telephone conversation with the Foreign Secretary

"The Attorney explained that he was concerned by reports he had received that the Prime Minister had indicated to President Bush that he would join them in acting without a second Security Council decision if Iraq did not comply with the terms of a resolution in the terms of the latest US draft. In the Attorney's view, OP10 of the current draft would not be sufficient to authorise the use of force without a second resolution.

"The Foreign Secretary explained the political dimension. He was convinced that the strategy of standing shoulder to shoulder with the US was right politically. It was also important to obtain a decent Security Council resolution.

"The Attorney understood and endorsed the politics behind the Government's approach. It was obviously important to get Bush on side behind a second UN resolution. He was not concerned about what Ministers said externally, up to a point. The Government must, however, not fall into the trap of believing that it was in a position to take action which it could not take. Nor must HMG promise the US government that it can do things which the Attorney considers to be unlawful."

Letter to the Prime Minister – 30.01.2003 (Day before meeting with Bush in White House.)

"In view of your meeting with President Bush on Friday, I thought you might wish to know where I stand on the question of whether a further decision of the Security Council is legally required in order to authorise the use of force against Iraq.

"You should be aware that, notwithstanding the additional arguments put to me since our last discussion, I remain of the view that the correct legal interpretation of Resolution 1441 is that it does not authorise the use of military force without a

further determination by the Security Council."

NB: later handwritten on top of note: "Specifically said we did not need further advice this week – Matthew 31/1." (No 10 aide, Matthew Rycroft)

... and afterwards

12.02.03: Goldsmith draft legal advice, after Blair meeting with Bush, and after Goldsmith's meetings with Jeremy Greenstock (UK ambassador to the United Nations)

"Since our meeting on 14 January I have had the benefit of discussions with the Foreign Secretary and Sir Jeremy Greenstock, who have given me valuable background information on the negotiating history of Resolution 1441. In addition, I have also had the opportunity to hear the views of the US Administration from their perspective as co-sponsors of the resolution.

"Having regard to the arguments of our co-sponsors which I heard in Washington, I am prepared to accept that a reasonable case can be made that Resolution 1441 revives the authorisation to use force in Resolution 678.

"However, if action were to be taken without a further Security Council decision, particularly if the UK had tried and failed to secure the adoption of a second resolution, I would expect the Government to be accused of acting unlawfully. Therefore, if these circumstances arise, it will be important to ensure that the Government is in a position to put up a robust defence.

"I must stress that the lawfulness of military action depends not only on the existence of a legal basis, but also on the question of proportionality.