Tony Blair's most senior legal adviser changed his mind about the legality of the Iraq war after a three-week lobbying campaign prompted by Downing Street, it has emerged.

In a defiant day of evidence to the Iraq inquiry, Lord Goldsmith said he remained convinced that he had been right to give his legal backing to the March 2003 invasion, despite believing it to be in breach of international law just two months earlier. But he revealed that his legal opinion was crucially swayed by a series of meetings, including a secret briefing with US government lawyers in Washington, arranged after No 10 learned of his continuing doubts.

It also emerged yesterday that the Government has not sanctioned the release of crucial documents showing the way in which Lord Goldsmith's legal advice changed. Frustrations over the Government's failure to allow the publication of key documents were laid bare as Sir John Chilcot, the inquiry's chairman, and Lord Goldsmith expressed anger that they could not refer to memos that were still being kept secret.

Download the new Independent Premium app Sharing the full story, not just the headlines

The inquiry heard that Lord Goldsmith sent a draft of his legal advice on the war to Mr Blair on 14 January 2003. It revealed that he still believed that military action would be illegal without further UN authorisation, despite the agreement of resolution 1441, which put further pressure on Saddam Hussein. "The Prime Minister accepted that it was for me to reach a judgment and that he had to accept it," he said.

However, the five-page draft caused consternation inside No 10 and was immediately sent to Jack Straw, the Foreign Secretary at the time, and Sir Jeremy Greenstock, then Britain's ambassador to the UN, who began to convince the peer to change his mind. Sir Jeremy told Lord Goldsmith that the signing of resolution 1441 meant that no further UN clearance was needed. Lord Goldsmith was also lobbied by Mr Straw, who wrote him a long memo on 6 February in which he told the Attorney General that he had failed to understand "both the negotiating history and the wording" of resolution 1441.

However, Lord Goldsmith said that the "most powerful" influence on his thinking was a secret meeting in Washington on 10 February with senior US government lawyers and George Bush's national security adviser, Condoleezza Rice. During the briefing, he was persuaded that French negotiators, the main opponents of the invasion, had admitted privately that military action could go ahead without further UN intervention. He also said that US negotiators had been ordered to ensure that a second UN resolution would not be necessary before invading Iraq.

"Sir Jeremy on his own had some good points. He moved me in my mind, but he didn't quite get me there," he said. "It was a combination of Jeremy Greenstock, Jack Straw and what happened in Washington." Lord Goldsmith admitted that the US team could not present much evidence that their French counterparts had conceded that military action could go ahead. "I wish they had presented me with more," he said. "At the end of the day, we were dependent on their view." He said it would have been impossible to ask the French directly what they thought the resolution had meant. "You cannot have the British Attorney General being seen to go to the French and ask them 'What do you think?' The message that would have given to Saddam Hussein about the degree of your commitment would have been huge," he said.

Lord Goldsmith said he changed his mind on the legality of any invasion just two days after the Washington meeting. Two weeks later, he revealed his change of heart to the Prime Minister and his staff. "I was able to tell them that there was a reasonable case, but that the safest course was to get a second resolution," he said. "As far as they saw it, I had given them the green light."

He was then asked by the Prime Minister's staff to set out his final verdict. His advice, first presented on 7 March, repeated that there was a "reasonable case" for sending in troops without further UN clearance. His final legal approval came three days before the war began, after the head of the military and civil service lawyers said they needed greater clarity.

The peer said he had disagreed with experienced international lawyers in the Foreign Office, who concluded that a further UN resolution was essential. Sir Michael Wood, the department's chief legal adviser, and his deputy, Elizabeth Wilmshurst, told the inquiry that all the lawyers within the department had agreed. "I paid great attention to their views, but ultimately I disagreed with the view that they took," Lord Goldsmith said. Yesterday, Mr Straw defended his decision to ignore repeated advice from lawyers in his own department that military action would be illegal. "I always take advice, but ministers have to decide," he said.

Inside Politics newsletter The latest news on Brexit, politics and beyond direct to your inbox Enter your email address Continue Continue Please enter an email address Email address is invalid Fill out this field Email address is invalid Email already exists. Log in to update your newsletter preferences Register with your social account or click here to log in I would like to receive updates on politics every morning by email Update newsletter preferences

Lord Goldsmith made clear that he "didn't agree" with the decision to keep some of the documents relating to his legal advice secret. Nick Clegg, the Liberal Democrat leader, said the decision had "all the hallmarks of a cover-up".

"Just as Liberal Democrats warned, the protocol on the release of documents is being used to gag the inquiry," he said. "If Tony Blair gets through on the nod due to the withholding of key documents, the public will rightly dismiss this inquiry as a whitewash."

A Cabinet Office spokesman said that no documents had been blocked from publication, but added that negotiations about some sensitive material were still taking place.

From no to yes: How the Attorney General changed his tune

24 July 2002 At a No 10 meeting, Lord Goldsmith says there is currently no legal basis for an invasion of Iraq. His letter to Tony Blair who is about to meet President Bush is not "terribly welcome".

8 November The UN Security Council passes resolution 1441, which puts more pressure on Saddam Hussein and warns him that he has one last chance to allow weapons inspectors to return.

11 November In a phone call with Jonathan Powell, Mr Blair's chief of staff, Lord Goldsmith tells him that he remains "pessimistic" that military action would be legal without a further UN resolution giving clear backing to the use of force.

14 January 2003 Lord Goldsmith presents Mr Blair with a draft version of his legal opinion on taking military action. It states that a further resolution from the UN authorising force is needed. No 10 sends the draft to Jack Straw and Sir Jeremy Greenstock, Britain's ambassador to the UN.

23 January Lord Goldsmith meets Sir Jeremy, who tells him that countries such as Russia and France, which had wanted to reserve the right to approve military action for the UN, "had lost, and they knew they had lost". Sir Jeremy says this is obvious from the way they have behaved.

6 February Mr Straw writes to Lord Goldsmith, demanding that he listen to his arguments and asking for a conversation before making any final judgments. Tells the peer that he has ignored "both the negotiating history and the wording" of resolution 1441.

10 February At Sir Jeremy's suggestion, Lord Goldsmith meets US lawyers and officials, including Mr Bush's national security adviser, Condoleezza Rice. They tell him the French had privately conceded further UN permission was not needed to press ahead with the invasion.

12 February Flies back to London. Finally convinced that the invasion would be legal without further UN authorisation, he alters his draft legal advice.

27 February Meets Mr Blair and his team to inform them of his change of heart. He is told to give his final ruling.

7 March Lord Goldsmith hands over his final, 13-page legal opinion, suggesting there is a "reasonable case" for military action without going back to the UN.

17 March Asked by the head of the military for a definitive answer, he tells Cabinet and Parliament that the imminent invasion would be lawful.

March 20 US-led invasion of Iraq begins.