President Barack Obama on Friday signed into law a bill barring US visas for UN envoys seen as a threat to American security or having engaged in "terrorist activity" - a measure aimed at Iran's ambassador.
Obama however said in a statement that the measure should be taken as an "advisory", because it could potentially interfere with his "constitutional discretion" to receive or reject ambassadors.
The United States said earlier this week that it would not issue a visa to Iran's chosen UN envoy Hamid Aboutalebi because he was involved in the 1979 hostage crisis at the US embassy in Tehran.
The new law signed by Obama, S.2195, bars from entering US soil "any representative to the United Nations who the president determines has been engaged in terrorist activity against the United States or its allies and may pose a threat to US national security interests."
"Acts of espionage and terrorism against the United States and our allies are unquestionably problems of the utmost gravity," Obama said in signing the measure, an amendment to current US legislation.
"I share the Congress' concern that individuals who have engaged in such activity may use the cover of diplomacy to gain access to our nation."
In 1979, dozens of American diplomats and staff were held for 444 days by radical Iranian students at the US embassy in Tehran.
The protracted standoff profoundly shocked the United States and led to the severing of all diplomatic ties between the US and Iran for the past three decades.
The spat over Aboutalebi's nomination has blown up amid a cautious thaw in relations as Tehran's new leadership seeks to negotiate a nuclear treaty with global powers.
As the host government, the United States is generally obliged to issue visas to diplomats who serve at the United Nations.
Aboutalebi, a veteran diplomat who currently heads Iranian President Hassan Rouhani's political affairs bureau, has insisted he was not part of the hostage-taking in November 1979, when a Muslim student group seized the US embassy after the overthrow of the pro-Western Shah.
He has acknowledged he served a limited role as a translator for the students who took the Americans hostage.