Lord Goldsmith, the government's attorney general at the time of the Iraq war, has told the Chilcot inquiry that he believed in 2002 there was no imminent threat from Saddam Hussein's regime that would have justified the use of force against him.

While he told the inquiry this morning that he believed a second UN resolution would have been "safer" to justify military action, he admitted he eventually concluded that a further reinforcement to the earlier resolution 1441 was not necessary.

Goldsmith has told the inquiry he changed his mind "for good reasons" but has not spelled them out, nor yet been asked by the inquiry what they were.

The change appears to have happened in late February 2003, just before the war, when he told the prime minister's advisers that there was "a reasonable case" that a second UN resolution was not needed. This was sufficient to constitute a "green light," he said. His previous advice had been preliminary.

The former attorney general spoke of the government as his "client". He said the prime minister had told him at a meeting shortly before the war: "'I do understand that your advice is your advice.' He accepted it was for me to reach a judgment and he had to accept that."

Goldsmith told the inquiry that he subsequently learned, over lunch with the French ambassador to London, that the French government did not believe it was necessary either. In the run-up to the war, the French president, Jacques Chirac, had made clear that France would not support a new resolution.

Goldsmith has also told the inquiry that in his judgment regime change was not a legitimate basis for the invasion.

He told the inquiry he had not attended cabinet meetings or cabinet committees discussing the possibility of war during 2002 and that he gleaned information about possible allied military plans from the press. He said "it would have been better" if he had attended cabinet; his judgement would have been important once the government's course of action had been agreed.

Goldsmith said: "My judgment was that there was not an imminence of threat that would justify us resorting to the use of force."

He said that he did not think his advice was welcome to the prime minister. Smiling, he told the inquiry: "I don't know, you'd have to ask Mr Blair that." The former prime minister is to appear before the inquiry on Friday.

He told the inquiry that he had told the then defence secretary, Geoff Hoon, that he was wrong to say that there was a clear basis for military action.

Goldsmith told the inquiry that the three justifications for the use of force against Iraq would have been self-defence, to avert a humanitarian catastrophe or authorisation by the UN.

He said he did not agree with the US policy of pre-emption. "The self-defence argument did not apply. There was no immediate threat," he said.

Goldsmith added that he was frustrated by the government's decision not to declassify some documents – a frustration clearly shared by Sir John Chilcot, chairman of the inquiry.

The former attorney general told the panel: "What I was anxious to do was to reach correct legal advice. I also had some concerns about public statements being made about what our position would be."