TEHRAN, Iran - Iran's top leader on Friday ruled out co-operation with America against the Islamic State group, their common enemy in Iraq and Syria, insisting that the United States remains Tehran's enemy despite a landmark nuclear deal with word powers.

Trusting the U.S. would be "a big mistake," said Supreme Leader Ayatollah Ali Khamenei, insisting that any co-operation with America goes "against independence" of Iran.

Despite the nuclear deal, which went into effect this year, Iran has "many small and big enemies, but foremost among them are America," Britain and Israel, he said.

Khamenei spoke at a ceremony marking the 27th anniversary of the death of Ayatollah Ruhollah Khomeini, the leader of the 1979 Islamic Revolution that brought hard-line clerics to power and ousted the U.S.-backed Shah Mohammad Reza Pahlavi.

Tens of thousands of Iranians attended the ceremony in Tehran while state TV broadcast Khamenei's 90-minute speech live.

The deal with world powers eased Tehran's isolation from the international community and removed many economic sanctions in exchange for Iran curtailing its nuclear program.

But the agreement, struck in 2015 with moderate President Hassan Rouhani's administration, has been assailed by Iranian hard-liners, and in the months since its implementation, Iran has conducted missile tests criticized by the U.S., as well as aired footage on state television of an underground missile base.

There has been no formal talk of a joint fight or even co-operation between Iran and the United States against the Islamic State group.

In Iraq, Iran's powerful Revolutionary Guards are on the front lines, backing Shiite militias and Iraqi government forces in their offensive to reclaim land from IS militants. U.S.-led airstrikes are also backing the offensive against the Islamic State.

In Syria, Iran is a top backer of Syrian President Bashar Assad, along with Russia. Tehran has deployed what it says are military advisers to support the government and has had casualties in the conflict, though it denies the presence of Iranian combat troops.

Meanwhile, the U.S. and its Western allies, along with most Gulf Arab nations, back the Syrian rebels fighting to topple Assad.