According to the ISNA news agency, the Iranian president has warned the United States, stating that peace with Iran would be crucial for Washington's policies.
"Mr. Trump, don't play with the lion's tail, this will only lead to regret," Rouhani added addressing a gathering of Iranian diplomats.
Only a day earlier Tehran had criticized the US, claiming it would not be possibleto reach an agreement with Washington.
Relations between the two countries have deteriorated since May when US President Donald Trump announced the withdrawal of his country from the Iranian nuclear deal and decided to re-impose unilateral sanctions on Tehran. The move was opposed by Russia, China, Germany, France, Great Britain and the EU, who have confirmed their commitment to the nuclear deal.