President Barack Obama has signed hurried legislation banning anyone from entering the US as a UN representative if they have a past in either espionage or terrorism, and are still considered a threat to the US.

The bill, signed into law on Friday, will block Iran’s nominated envoy to the UN, Hamid Aboutalebi (pictured), from entering the country.

The US had already said it would not grant Aboutalebi an entry visa, citing his alleged involvement in the 1979 hostage drama at the US Embassy in Tehran – where 52 US citizens were held hostage for 444 days by radical Iranian students. Aboutalebi is suspected of membership in the group.

Friday’s new legislation bars anybody from receiving a visa to serve at the UN headquarters in New York if they are seen as a threat to US security or are accused of complicity in “terrorist activity.”

Obama said in a statement, however, that the legislation should be treated as an “advisory,” because it could potentially interfere with his “constitutional discretion” to receive or reject ambassadors.

“Acts of espionage and terrorism against the United States and our allies are unquestionably problems of the utmost gravity,” Obama said when signing the bill.

“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.”

Iran said that it did not intend to appoint a replacement diplomat, saying in a letter to the White House that the refusal would have “negative implications for multilateral diplomacy and will create a dangerous precedence and affect adversely the work of intergovernmental organizations.”

The Muslim News Awards for Excellence event is to acknowledge British Muslim and non-Muslim contributions to society. Over 850 people from diverse background, Muslim and non-Muslim, attended the gala dinner.