The Iranian foreign minister, Javad Zarif, has hit back at Donald Trump’s “genocidal taunts” after a strongly worded warning from Trump that Tehran should not think of attacking the US.

“Goaded by # B_Team,” Zarif wrote on Twitter, in an apparent reference to Trump advisers such as John Bolton, “@realdonaldTrump hopes to achieve what Alexander, Genghis & other aggressors failed to do. Iranians have stood tall for millennia while aggressors all gone. # EconomicTerrorism & genocidal taunts won’t ‘end Iran’.”

He added: “ # NeverThreatenAnIranian. Try respect – it works!”

Iranian president Hassan Rouhani said late on Monday he favoured talks and diplomacy but not under current conditions, according to state news agency IRNA. “Today’s situation is not suitable for talks and our choice is resistance only,” Rouhani was quoted as saying.

Trump said on Monday provocations by Iran – which he called the “No. 1 provocateur of terror.” – would be met with “great force,” but that he was also willing to negotiate.

On Sunday, Trump warned Iran not to threaten the US or else it would face its “official end”, shortly after a rocket landed near the US embassy in Baghdad overnight.

Trump’s tweet came after he had seemingly sought to soften his tone on Iran following days of heightened tension sparked by his administration’s sudden deployment of bombers and an aircraft carrier to the Persian Gulf over still unspecified threats.

In the time since, officials in the United Arab Emirates have alleged four oil tankers sustained damage in a sabotage attack, Yemeni rebels allied with Iran have launched a drone attack on an oil pipeline in Saudi Arabia, and US diplomats have relayed a warning that commercial airlines could be misidentified by Iran and attacked, something dismissed by Tehran.

All these tensions are the culmination of Trump’s decision a year ago to pull the US out of Tehran’s nuclear deal with world powers. And while both Washington and Tehran say they do not seek war, many worry any miscalculation at this fraught moment could spiral out of control.

On Sunday a Katyusha rocket fell in Baghdad’s heavily fortified Green Zone, near the statue of the Unknown Soldier less than a mile from the US embassy, causing no injuries. An Iraqi military spokesman, Brig Gen Yahya Rasoul, told the Associated Press that the rocket was believed to have been fired from east Baghdad. The area is home to Iran-backed Shia militias.

“If Iran wants to fight, that will be the official end of Iran,” Trump tweeted. “Never threaten the United States again!”

Jeremy Hunt, the UK foreign secretary, urged Tehran to take Trump seriously. Speaking in Geneva, Hunt said: “I would say to the Iranians: do not underestimate the resolve on the US side. They don’t want a war with Iran. But if American interests are attacked, they will retaliate. And that is something that the Iranians needs to think about very, very carefully.”

Trump campaigned on pulling the US from the 2015 nuclear accord, under which Iran agreed to limit its enrichment of uranium in exchange for the lifting of economic sanctions. Since the withdrawal, the US has re-imposed previous sanctions and come up with new ones, and it has warned nations around the world they will be subject to sanctions too if they import Iranian oil.

Iran has announced it will begin backing away from terms of the deal, setting a 60-day deadline for Europe to come up with new terms or else it will begin enriching uranium closer to weapons-grade levels. Tehran long has insisted it does not seek nuclear weapons, though the west fears its programme could allow it to build atomic bombs.

In an interview aired on Fox News, Trump called the nuclear deal a “horror show”. “I just don’t want them to have nuclear weapons and they can’t be threatening us,” Trump said.

The nuclear deal had kept Iran from being able to acquire enough highly enriched uranium for a bomb. UN inspectors repeatedly certified that Iran was in compliance with the accord.

There is an open debate in Tehran over whether Trump is seriously threatening war with Iran or instead using a form of psychological warfare to persuade the Iranians to renegotiate the 2015 Iran nuclear deal.

On Monday afternoon he tweeted less alarmingly, criticising reports the US was trying to set up talks and adding: “Iran will call us if and when they are ever ready. In the meantime, their economy continues to collapse – very sad for the Iranian people!”