President Hassan Rouhani says the current US administration is in a war against Iran to stamp out the legitimacy of the Islamic Republic and bring about a "regime change," but that Tehran will foil the plot.

"Over the past 40 years, there has not been a more spiteful team than the current US government toward Iran and the Islamic Republic," Rouhani said at Tehran University Sunday, in a speech marking the beginning of the new academic year.

"They started with a psychological war; their next goal is an economic war and an attempt to portray [the Islamic Republic] ineffective, and their ultimate goal is to delegitimize the system and change it," he added.

Rouhani said there was a time when there was one person who had enmity with Iran and the rest were moderate, but now the worst of them have gathered at the White House.

The president said Iran has defeated the US in many arenas before and will thwart all its conspiracies with unity and integrity again.

He touched on Washington's isolation after its withdrawal from a 2015 nuclear deal with Iran, called the Joint Comprehensive Plan of Action (JCPOA). Rouhani said except for a few regimes, all countries view the move as "illegal" and a "mistake."

"From a political standpoint and a foreign policy perspective, Iran is certainly the winner and America the loser," in what has so far transpired.

Rouhani said Iran responded to the US withdrawal with "prudence" and refrained from hurriedly walking out of the JCPOA.

Iran, he said, can leave the JCPOA "whenever" it chooses but that national interests and security are what come first.

Under the Trump administration, the US has taken an increasingly hostile approach toward Iran.

In May, Trump pulled his country out of the JCPOA, despite objections from the other signatories to the multilateral nuclear accord.

In August, he re-imposed the first round of sanctions on Iran, with the second phase due to come into effect early next month, targeting the country's oil exports.

Vice President Es'haq Jahangiri on Sunday played down the impact of the planned restrictions, saying Iran has been able to find new partners to buy its oil even though some countries have stopped their purchases.

"America will certainly not be able to reduce Iran's oil exports to zero," he said, dismissing a pledge by President Trump to obliterate the Islamic Republic's oil trade.

"America thinks Saudi Arabia can replace this oil. But right now Iran's oil has reached more than $80 and with half the previous exports we will have the same income as before," Jahangiri added.