Ex-attorney general gives new evidence stating he was repeatedly shut out of crucial talks ahead of decision on lawfulness of Iraq invasion

Tony Blair repeatedly shut out his government's chief legal adviser from crucial talks about the legality of an invasion of Iraq, evidence released by the Chilcot inquiry tonight reveals.

Lord Goldsmith, then attorney general, records how he was "no longer actively consulted" after warning Blair face-to-face five months before Britain joined US-led military action that an invasion would be in breach of international law.

In a written statement to the inquiry, Goldsmith describes how he was kept out of the loop by some of the-then prime minister's closest advisers in Downing Street and by Jack Straw, then foreign secretary, after meeting Blair on 22 October 2002. "My advice was not sought" about UN negotiating tactics, he writes. He adds: "I was not being sufficiently involved in the meetings and discussions about the [UN] resolution and the policy behind it that were taking place at ministerial level."

Goldsmith was kept out of the high-level discussions despite his office telling Sir David Manning, Blair's foreign policy adviser, on the day after the 22 October 2002 meeting that "it will be important for the attorney to be kept closely informed of developments". Goldsmith's new statement was released by the Chilcot inquiry in advance of Blair's second appearance before the five-member panel on Friday.

Documents already released by the inquiry – after Blair first gave evidence a year ago – showed how Goldsmith warned of the consequences of invading Iraq without fresh UN authority on 30 January 2003, the eve of Blair's final pre-war meeting with George Bush in Washington.

The document contains a handwritten note by Manning, warning: "Clear advice from attorney on need for further resolution." Blair scrawled in the margin: "I just don't understand this." In his statement released tonight, Goldsmith described how Jonathan Powell, Blair's chief of staff, was one of those who discouraged him from giving his advice on the legality of military action. "I was told that I was not being called on to give advice at this stage [October 2002]," Goldsmith says.

Goldsmith has criticised Blair for publicly suggesting Britain could attack Iraq without fresh UN backing despite receiving clear legal advice to the contrary.

Goldsmith also makes clear that Blair was wrong when he told the Commons on 15 January 2003 that a fresh UN resolution was not needed if a country imposed an "unreasonable veto". That, too, was "incompatible" with the advice he had given the prime minister, he says.Early in February 2003, Blair told BBC2's Newsnight programme he would consider action if a UN security council member – a reference to France – "unreasonably" vetoed a new resolution. Asked by the Chilcot inquiry whether Blair's words were compatible with the advice he received, Goldsmith replies: "No." He adds that he was "uncomfortable" about public "statements" being made by Blair.

By 7 March, after visiting Bush administration lawyers in Washington, Goldsmith told Blair that a new UN resolution might not be needed after all, though war without one would risk Britain's indictment before an international court.

Admiral Michael Boyce, then chief of the defence staff, who has also been summoned back to the inquiry to give further evidence, demanded "unequivocal" advice that an invasion was lawful.

Documents released tonight include a letter from Goldsmith's office to Matthew Rycroft, then a close aide to Blair, saying: "The attorney general understands that it is unequivocally the prime minister's view that Iraq has committed further material breaches [of UN resolutions] but as this is a judgment for the prime minister, the attorney would be grateful for confirmation that this is the case."

The next day, 15 March 2003, Rycroft told the attorney's office that "it is indeed the prime minister's unequivocal view … " Critics of Goldsmith, including many senior British lawyers, say that the attorney passed the buck by asking for Blair for his judgment in such a way.

Goldsmith tells Chilcot that on 13 March he reflected "on the position … and concluded that the better view was that there was a lawful basis for the use of force without a further [UN] resolution". On 17 March, Goldsmith published a short note saying an invasion was lawful.

Documents published by the inquiry last night include a note from Straw to Blair days before Blair met Bush at the president's Crawford ranch in Texas in April 2002, nearly a year before the invasion. He warned Blair: "The rewards from your visit to Crawford will be few ... there is at present no majority inside the PLP for any military action against Iraq."

Straw warned of two legal "elephant traps".

He said "regime change per se is no justification for military action", and "the weight of legal advice here is that a fresh [UN] mandate may well be required".

Despite the warnings, a previously leaked briefing paper for a meeting of the war cabinet in July 2002 states: "When the prime minister discussed Iraq with President Bush at Crawford in April he said that the UK would support military action to bring about regime change."

A spokesman for Tony Blair said last night: "The basis [for military action] was that given in the attorney general's advice which he has confirmed in the statement published today.

What Peter Goldsmith's statement does is make it categorically clear that there was a proper legal basis for the military action taken." The spokesman referred to Goldsmith's admission in his statement that his later legal advice constituted a "green light" for military action.