Tehran, Iran - Just hours after a data dump by the CIA alleging among other things collusion between Iran and al-Qaeda, Mohammad Javad Zarif, Iran's foreign minister, responded via Twitter.

"A record low for the reach of petrodollars: CIA & FDD fake news w/ selective AlQaeda docs re: Iran can't whitewash role of US allies in 9/11," Zarif said.

The target of his criticism was the CIA and the US-based Foundation for the Defence of Democracies (FDD).

Both organisations have been at the centre of the latest revelations from a trove of computer files found on al-Qaeda leader Osama bin Laden's hard drives.

He was killed by a US Navy SEAL team during a raid on his compound in Pakistan in 2011.

The allusion in Zarif's tweet is a commonly held belief in Iran: that al-Qaeda's September 11, 2001, attacks on the US were an inside job.

The accusation may seem outlandish for a sitting foreign minister of any country to level.

But to an Iranian, the message is clear: The US is the main protagonist of "terror" in the world and has no business hurling accusations against Iran.

This is not the first time that Iran has been accused of secret dealings with al-Qaeda.

In years past, Iran's government has dismissed this kind of things as Western propaganda.

Now the accusation is coming at a time when Iran sees itself as a regional counterterror powerhouse.

"I think this is part of a psychological war launched by America and by the CIA against Iran to disgrace Iran's face in the international arena," Hossain Ansarifard, a Tehran-based political analyst, told Al Jazeera.

"Iran is encircled by al-Qaeda in Afghanistan, Iraq, Syria, and [it] is trying to manage these activities on [its] borders.

"Everybody knows that al-Qaeda's ideological principles are quite against Iran and against Iran's regime. So, it's ridiculous to say that they are working with and they are collaborating with Iran."

Strategic sense

For an outside observer, the allegation carries some logic. Iran's foreign policy is nothing if not driven by self-interest, so this would seem to make strategic sense.

And both al-Qaeda and Iran see the US as the enemy.

But when it comes to making foreign policy, the enemy of Iran's enemy is not Iran's friend.

"We say America is the enemy and al-Qaeda is the enemy, too," Ansarifard said.

In a speech to students in Tehran on Thursday, Iran's Supreme Leader Ayatollah Ali Khamenei said, the country will never accept being bullied over the 2015 nuclear deal

Since US President Donald Trump decertified the deal to US Congress in October, paving the way for new US sanctions, the decision has received nearly daily public rebukes from Iranian leaders.

"Any retreat by Iran will make America more blatant and impudent," Khamenei said, adding: "Resistance is the only option."

That kind of defiance is a product of Iran's own experience with American intervention, as well as the more recent history of the second Iraq war that toppled Saddam Hussein.

That conflict was preceded by similar allegations of ties to al-Qaeda as well as the existence of weapons of mass destruction.

Neither accusation was proved true in the end but caused generations of chaos and conflict across the region.

'Cannot happen again'

Iran's leaders say that kind of thing cannot happen again.

On Tuesday, the commander of the Iranian Revolutionary Guards Corps was the keynote speaker at an event entitled, A World Without Terror.

"If you are waiting for a world without terror and terrorism, we should be after a world without the United States," Mohammad Ali Jafari said.

Like Zarif, he also asserted that 9/11 was an inside job. The attack, he said, was orchestrated as a pretext to invade Afghanistan and Iraq. He also suggested that ISIL and the US are partners in crime in the Middle East.

{articleGUID}

"If Iran wasn't involved in Syria and Iraq, today [ISIL] would control these countries, and hand in hand with the U.S., would kill Muslims," he said.

The optics were carefully managed.

Young high school boys were brought in buses to fill an auditorium next to a museum for martyrs.

Outside the venue, students carried signs that showed the US president with his mouth zipped shut.

Posters taped to nearby walls read: "Keep Calm and Shut Up Trump."

Others showed a clenched fist holding a rubbish bag filled with the "tools of terrorism"; American money, American made guns and bullets, sticks of dynamite marked with the Star of David, and a keyboard signifying the threat of cyberattacks.

Even before walking inside, attendees were given a snapshot of how Iran's government sees its place in the world; America - along with ally Israel - is the biggest threat to peace in the region, and Iran has the job of taking out the rubbish.