Donald Trump has threatened Iran with destruction if it seeks a fight with the US.
The US president issued the warning after a rocket landed less than a mile from the US Embassy on Sunday in Baghdad's Green Zone, further stoking tensions in the region.
Mr Trump tweeted: "If Iran wants to fight, that will be the official end of Iran. Never threaten the United States again!"
Iranian officials say the country is not looking for war.
Mr Trump had seemed to soften his tone after the US recently sent warships and bombers to the region to counter an alleged, unexplained threat from Iran.
If Iran wants to fight, that will be the official end of Iran. Never threaten the United States again!— Donald J. Trump (@realDonaldTrump) May 19, 2019
On Thursday, when asked if the US and Iran were heading towards armed conflict, he answered: "I hope not."
On Saturday, Iran’s foreign minister Mohammad Javad Zarif played down fears of a possible conflict.
"There will not be a war since neither we want a war nor does anyone have the illusion they can confront Iran in the region," he said.
On Monday, he responded with a tweet of his own in English.
Mohammad Javad Zarif posted his reply on Twitter, saying Mr Trump had been "goaded" into "genocidal taunts".
Mr Zarif wrote that Mr Trump "hopes to achieve what Alexander (the Great), Genghis (Khan) & other aggressors failed to do".
He added: "Iranians have stood tall for a millennia while aggressors all gone."
Goaded by #B_Team, @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". #NeverThreatenAnIranian. Try respect—it works!— Javad Zarif (@JZarif) May 20, 2019
He ended his tweet with #neverthreatenaniranian and: "Try respect - it works!"
Citing the Iraqi military, Reuters reported a rocket attack in the capital's heavily fortified Green Zone, home to government headquarters and the US embassy.
The agency said a Katyusha rocket crashed inside the area in Baghdad without causing any casualties.
Alert sirens sounded briefly in the capital after the explosion was heard.
The apparent attack comes amid heightened tensions across the Persian Gulf, after the White House ordered warships and bombers to the region earlier this month to counter an alleged, unexplained threat from Iran.
It is not yet clear who was behind the rocket attack.
The US also recently ordered non-essential staff out of its diplomatic posts in Iraq.
Iraq hosts more than 5,000 US troops and is home to powerful Iranian-backed militias, some of whom want the American forces to leave.