In a live televised address, Mr Rouhani branded the sanctions against Ayatollah Ali Khamenei and other senior officials, including Iran’s foreign minister Mohammad Javad Zarif, as “outrageous and idiotic”.
"You sanction the foreign minister simultaneously with a request for talks," he said, adding: "The White House is afflicted by mental disability and does not know what to do."
Iran had earlier warned that Monday’s sanctions meant the permanent closure of diplomatic channels between Tehran and Washington.
Foreign ministry spokesman Abbas Mousavi said the American government was “destroying the established international mechanisms for maintaining world peace and security”.
Mr Trump said the “hard-hitting” sanctions, which came following weeks of escalating tensions between the two countries, were “a strong and proportionate response to Iran’s increasingly provocative actions”.
The president’s national security adviser, John Bolton, an Iran hawk with a history of calling for military action against the Islamic republic, has insisted Washington is still willing to talk to Tehran.
“The president has held the door open to real negotiations to completely and verifiably eliminate Iran’s nuclear weapons programme, its ballistic missile delivery systems, its support for international terrorism and other malign behaviour worldwide,” he said.
“All that Iran needs to do is to walk through that open door.”
Tensions have been mounting in the Gulf since Mr Trump withdrew the US from a 2015 multilateral deal in which Iran agreed to limit its nuclear programme in return for the lifting of crippling economic sanctions.
Those tensions culminated in the shooting down of a US drone last week. Mr Trump said he ordered reprisal air strikes but called them off at the last minute when an adviser told him it would result in an estimated 150 deaths.
The US has also blamed Iran for attacks on two oil tankers this month near the Strait of Hormuz, though officials have so far provided only shaky evidence for the claim, which Iran denies.
According to the IRIB news agency, foreign minister Mohammad Javad Zarif said on Tuesday Iran would never pursue a nuclear weapon.
He pointed to the past use of nuclear weapons by the US and to Mr Trump's comment about wanting to avoid the deaths of 150 people.
"You were really worried about 150 people? How many people have you killed with a nuclear weapon? How many generations have you wiped out with these weapons?" Mr Zarif said.
"It is us who, because of our religious views, will never pursue a nuclear weapon," he added.
Washington claimed Monday's sanctions measures effectively freeze billions of dollars worth of Iran assets, but experts said the true impact was likely to be limited.
Richard Johnson, the US state department’s former acting assistant coordinator of the Iran nuclear deal, told BBC Radio 4’s Today programme: “Frankly I doubt that there’s many international companies doing business with these organisations, so I don’t think the sanctions will have a really substantive effect on Iran’s economy.
“I do think it’s much more symbolic than it is substantive.”
On Tuesday the UK, Germany and France issued a joint statement calling for "de-escalation and dialogue" amid "grave concern" about increased tensions in the Gulf.
They also reiterated their commitment to the 2015 nuclear deal, and urged "all sides to do the same".
"It is in everyone’s interest to show restraint and avoid any actions that would undermine this vital pillar of the non-proliferation regime and of our collective security," the statement said.
The original version of this article quoted Iranian president Hassan Rouhani as describing the White House as being "afflicted by mental retardation," based on a translation from Reuters. This has now been updated to include a more specific translation.
Additional supporting by agencies
Register for free to continue reading
Registration is a free and easy way to support our truly independent journalism
By registering, you will also enjoy limited access to Premium articles, exclusive newsletters, commenting, and virtual events with our leading journalists
Already have an account? sign in
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies