Tony Blair "misread" Iran's view on efforts to build a democracy in Iraq after the 2003 invasion, a former UK ambassador to Tehran has said.
Tehran did not wish to "destabilise" efforts to establish a government after Saddam Hussein's overthrow, Sir Richard Dalton told the Iraq inquiry.
Mr Blair said Tehran was worried about a "democracy on its doorstep" and ended up aiding al-Qaeda-backed insurgents.
Sir Richard said this was "exaggerated" and Iran did not want anarchy in Iraq.
The Chilcot inquiry is continuing to examine the UK's involvement in the 2003 military action in Iraq and its aftermath.
Giving evidence in January, the former prime minister said "nobody foresaw" the extent to which the Iranian government would end up supporting al-Qaeda and that this would exacerbate levels of violence in Iraq from 2004 onwards.
He suggested that Tehran and al-Qaeda had a "common interest" in disrupting US and UK-led efforts to bring stability to the country.
But Sir Richard, the UK's most senior diplomatic official in Tehran between 2003 and 2006, said this was an misinterpretation of Iran's actions.
"I thought he [Mr Blair] very much exaggerated this factor," he said.
"I did believe at the time - particularly in 2003 - there was a misreading of Iran as inevitably hostile to the success of the coalition mission to replace Saddam with an Iraqi regime that would be democratic."
While Iran did wish to make life difficult for the coalition, so their troops did not remain in Iraq for years, he said its support for al-Qaeda was limited to allowing fighters to pass through its territory.
Most attacks on coalition troops were by remnants of the former Iraqi regime, he suggested.
"Their [Tehran} objective was never to destabilise Iraq to the point at which the whole enterprise would fail," he said. "They feared anarchy."
Sir Richard, who has been critical of the war in the past, suggested the Blair government had made a series of "very bad decisions" about its legality.
He also criticised comments by Mr Blair suggesting he would have been prepared to take similar action again other "repressive or failed" states with links to weapons of mass destruction - seen as a warning over the threat posed by Iran's nuclear ambitions.
"I felt strongly then and I do now that a military adventure against Iran... would be illegal in the absence of an imminent and real threat to any country."
Sir Richard's successor in Tehran - Sir Geoffrey Adams - told the inquiry that many Iranians wanted a stable and prosperous Iraq which could be a growing market for its goods and services.
However, he said that others in Iran believed this was an opportunity to "put pressure" on US and UK troops in Iraq.
"One of the objectives of Iranian policy was that the coalition should not be able to leave Iraq with their heads held high or be able to claim legitimately that their mission had been a success," he said.