Giving evidence on the first day of public hearings, Sir William Patey, a senior Foreign and Commonwealth Office official, said the idea of ousting Saddam Hussein had been discussed in an internal FCO paper.
However, he said it been dismissed at the time as having "no basis in law".
Sir William, who was head of the FCO Middle East Department, said he had asked his staff to look at all the options for dealing with the growing threat from Saddam.
"This is a paper I commissioned from my staff and said 'Come on, let's have the whole range of options out here'," he said.
He said it went from "'hard' containment to 'soft' containment, to the lifting of sanctions, to - I have to say - we had at the end the regime-change option - which was dismissed at the time as having no basis in law.
"It was very much an internal paper. We didn't go into how to achieve regime change."
The inquiry heard that even in early 2001, elements of the new US administration of President George Bush were already discussing the possibility of "regime change" in Iraq.
Sir Peter Ricketts, who was chairman of the Joint Intelligence Committee (JIC), said there was concern in both London and Washington that the strategy of "containment" of Saddam Hussein was "failing".
The strategy - which had been the basis of US and British policy since the 1991 Gulf War - involved sanctions combined with an offer to lift them if Saddam allowed United Nations weapons inspectors to return, and the northern and southern "no fly" zones.
Sir Peter said that by 2001 all three strands were "in trouble" due to the rise of smuggling, Saddam's growing standing in the Arab world and the increasing unpopularity of the measures in Iraq.
Britain had favoured a strengthened "smart sanctions regime" - a position initially backed by senior figures in the Bush administration like Secretary of State Colin Powell.
However he said they were aware there were other influential figures in Washington who were taking a harder line.
"We were conscious that there were other voices in Washington, some of whom were talking about regime change," he said.
He cited an article written by National Security Adviser Condoleezza Rice warning that "nothing will change" in Iraq until Saddam was gone.
Sir William added: "We were aware of these drum beats from Washington and internally we discussed it. Our policy was to stay away from that."
At the same time, Sir Peter said there was concern within the JIC that Saddam was continuing to try to acquire weapons of mass destruction (WMD).
"In 2001 we were seeing an acceleration of work on missile programmes, we saw increased Iraq efforts to secure material for the nuclear programme and we saw continuing interest in CW (chemical weapons) research and development," he said.
Following the 9/11 attacks on the Twin Towers in New York and the Pentagon in Washington, he said there had been a further hardening of opinion in the US.
"We heard people in Washington thought there might be some link between Saddam Hussein and Osama bin Laden - undocumented. I don't think we saw any evidence of it," he said.
"The tone of voice was more if there turns out to be any link between Saddam Hussein and Osama bin Laden that is going to have major implications for Iraq and Saddam Hussein."
Simon Webb, who was policy director at the Ministry of Defence, said the change in the US was "dramatic".
"The shift in thinking was to say that we cannot afford to wait for these threats to materialise. We must be ready to engage potential threats wherever they emerge," he said.
While the initial response concentrated on Afghanistan - where the 9/11 attacks had originated - Sir Peter said that, from November 2001, he began to hear talk in Washington of a "phase 2" in the "war on terror".
He said the attacks also had the effect of making the Pentagon rather than the State Department the "dominant instrument" in American foreign policy.
Mr Webb said that while there was no immediate change of policy in Washington to support regime change, that was where the policy debate was heading.
"The focus didn't shift to regime change. It shifted to the weapons of mass destruction problem which, in the case of Iraq, in order to deal with the weapons of mass destruction problem, you would probably end up having to push Saddam Hussein out of power," he said.
Sir Peter said that while the attacks had raised the "salience and prominence" of counter-terrorism and the non-proliferation of WMD in Whitehall, they did not at that stage affect Britain's policy on Iraq.
"We still had our focus on the weapons inspector route and the sanctions-type route. We had heard these noises about regime change. They weren't really impinging on the Whitehall policy debate at that point," he said.
He said that if the 9/11 attacks had not happened, Britain would continued to have pursued its policy of strengthening sanctions through the UN Security Council.
"I'm pretty sure we would have stuck to our guns on the policy we had," he said.