"To Iranian President Rouhani: Never, ever threaten the United States again or you will suffer consequences the likes of which few throughout history have ever suffered before," Trump wrote on Twitter. "We are no longer a country that will stand for your demented words of violence & death. Be cautious!"
The tweet was written in all capital letters.
The tweet comes a day after Rouhani gave a televised speech in which he spoke directly to Trump.
"Mr. Trump: We are the honest men who have throughout history guaranteed the safety of this region's waterways," Rouhani said. "Do not play with the lion's tail, it will bring regret."
Cmdr. Gen. Gholam Hossein Gheibparvar, a senior officer in Iran's Revolutionary Guards, dismissed Trump's remarks as "psychological warfare," CNN reported on Monday, citing Iran's semi-official INSA news agency.
Secretary of State Mike Pompeo on Sunday accused the Iranian leader and other government officials of trying to spread a violent revolution across the Middle East while profiting from corruption.
"The ideologues who forcibly came to power in 1979 and remain in power today are driven by a desire to conform all of Iranian society to the tenets of the Islamic revolution. The regime is also committed to spreading the revolution to other countries, by force if necessary," Pompeo said during a speech at the Ronald Reagan Presidential Library in Simi Valley, Calif.
Pompeo added: "The level of corruption and wealth among regime leaders shows that Iran is run by something that resembles the mafia more than a government... These hypocritical holy men have devised all kinds of crooked schemes to become some of the wealthiest men on earth while their people suffer."
Iranian Foreign Ministry spokesman Bahram Qasemi responded to Pompeo's comments on Monday, calling them "hypocritical and absurd statements" and "a propaganda move."
"Pompeo's words constituted very clear evidence showing the U.s. efforts to meddle in Iran's internal affairs," Qasemi said.
The tough words between Rouhani and the Trump administration follow Trump's plan to reimpose sanctions on Iran over the country's efforts to develop nuclear technology, which could cause Iran's oil exports to fall by as much as a third by the end of 2018, Sky News reported.