Asked what it would take for Trump to meet with Rouhani as he did with Kim, Sanders replied, "I'm not going to get into specifics and certainly not negotiate with the press".
Israeli Prime Minister Benjamin Netanyahu praised the administration's tough stance.
That is when Trump announced his decision to withdraw the United States from a 2015 worldwide agreement over Iran's nuclear program.
"WE ARE NO LONGER A COUNTRY THAT WILL STAND FOR YOUR DEMENTED WORDS OF VIOLENCE & DEATH", Trump added.
The deal saw six countries - the US, UK, France, Germany, Russia and China - agree to lift sanctions against Iran in exchange for limitations on Iran's nuclear program.
He also said the government in Tehran has "heartlessly repressed its own people's human rights, dignity and fundamental freedoms". "We're not attacking Iran".
Many Iranians are anxious that the war of words might lead to a conflict.
More Trump tweeting: "Remember what I previously said".
The message echoed remarks Trump made to North Korean dictator Kim Jong-un in August previous year amid a flurry of missile tests.
Earlier, US Secretary of State Mike Pompeo launched his own rhetorical assault on Iran's leaders, comparing them to a "mafia" and promising unspecified backing for Iranians unhappy with their Government.
Iran's Foreign Minister Mohammad Javad Zarif also took to Trump's favorite social media platform to say how unimpressed he was with United States threats, his statement only partially written in capital letters.
In pointed remarks, Pompeo said that Iran's supreme leader, Ayatollah Ali Khamenei, controls a hedge fund valued at $95 billion - a fund called the Setad (and on which Reuters did a special report in 2013).
"The people and armed forces will stand firm in the face of our enemies, and will not retreat".
Pompeo's words come after months of protests in Iran over economic hardships and frustration with leadership.
The statement from President Rouhani that set off Trump was a clear threat to the United States.
There is little interest among United States lawmakers for a conflict with Iran.