"Everyone knows that America has lost legally and politically by giving up on its international obligations and that we have achieved victory," Rouhani said in a speech at the University of Tehran to mark the beginning of the school year.
"There are but a few countries in the world that would call the US withdrawal from the JCPOA (nuclear deal) a good move," he added.
"Those that are cautious express disappointment, those that are more frank say it was a mistake, and the outspoken say it was illegal."
The United States pulled out of the landmark nuclear deal between Iran and six world powers in May and is reimposing sanctions on the country, hoping to pressure Tehran into what President Donald Trump calls a "better deal".
The US is due to complete the reimposition of sanctions on November 4, targeting Iran's oil sector and Central Bank.
"There has never been a more spiteful team than the current US administration toward Iran, Iranians and the Islamic Republic," Rouhani said.
"There was a time when there was one person who had enmity. The rest were moderate. Now...the worst have gathered around each other," he added.
He said nothing would change on November 4 since "America has already done whatever it can".
The other parties to the nuclear agreement – Russia, China, the UK, France and Germany – have all pledged to continue to try to make the deal work, despite their firms being vulnerable to the US sanctions if they keep doing business with Iran.
Rouhani said Iran's response had left Washington "emptyhanded".
"They expected us to leave the JCPOA hours after they announced they are, and what would have happened? The case would have returned to the UN Security Council, turned against Iran and isolated us," he said.
He said Iran had lost nothing by staying in the deal and could leave "whenever" it chooses.
US ultimate goal
Rouhani also said the US is seeking "regime change" in Iran.
Rouhani accused the US of using psychological and economic warfare and questioning the legitimacy of the Islamic Republic.
"They started with a psychological warfare; 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.
"When they say getting rid of, regime change in their own words, how does regime change happen? Through reducing legitimacy, otherwise a regime doesn't change,"
He used the English phrase "regime change" to emphasize his point.
The Trump administration says its aim is not to overthrow the Iranian government, but to pressure it to radically alter its policies, including its development of ballistic missiles and support for regional resistance groups.
AFP, Reuters and Press TV contributed to this story.