Updated

President Obama signed legislation Friday aimed at blocking Iran's chosen ambassador to the United Nations because of his ties to the 1979 takeover of the U.S. Embassy in Tehran. But the president says he's only treating the legislation as guidance.

The unusual legislation bars anyone from entering the U.S. as a U.N. representative if they've engaged in espionage or terrorist activity and still pose a threat to U.S. security. It's aimed at blocking Hamid Aboutalebi, a member of the Muslim student group that held 52 Americans hostage for 444 days during the embassy takeover.

Aboutalebi has insisted his involvement in the group was limited to translation and negotiation. And Iran has accused the U.S. of setting a dangerous precedent by violating the right of sovereign states to designate representatives to the United Nations -- a touchy dispute amid efforts between Washington and Tehran to thaw relations over Iran's nuclear program.

The administration has said Aboutalebi was an unacceptable choice and refused to grant him a visa. Yet the White House had been noncommittal about whether Obama would sign the legislation that Congress passed earlier this month.

The White House announcement that Obama privately signed the legislation on Good Friday afternoon was accompanied by what's known as a signing statement. Presidents occasionally issue signing statements to assert that they believe part of the legislation is unconstitutional and therefore they intend to ignore it or implement it in a way they see fit.

Obama has issued signing statements infrequently. His predecessor George W. Bush wielded the power often, using signing statements to object to more than 700 provisions in laws, according to the Library of Congress.

"Acts of espionage and terrorism against the United States and our allies are unquestionably problems of the utmost gravity, and 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," Obama said in the statement. But he said he will treat the legislation as advisory out of concern it could interfere with his discretion to receive ambassadors.

As host country for the United Nations, the U.S. must provide rights to persons invited to the New York headquarters. However, exceptions can be made when a visa applicant is found to have engaged in spying against the U.S. or poses a threat to American national security.

Despite the decades-long tension between the U.S. and Iran, the Islamic republic maintains a robust diplomatic mission at U.N. headquarters in New York. The U.S. frequently allows visas for representatives from countries it disfavors, including Syria and North Korea, but restricts their diplomats' movements and activities to a 25-mile radius of New York City.

Denying visas to U.N. ambassadorial nominees or to foreign heads of state who want to attend United Nations events in the U.S. is extremely rare, though there appears to be precedent. According to a paper published by the Yale Law School, the United States rejected several Iranians appointed to the U.N. in the 1980s who had played roles in the embassy hostage crisis or other acts against American citizens.

The United Nations was on holiday Friday and officials at the Iranian U.N. Mission were not available for immediate comment on the decision.  Iran can choose to nominate a different ambassador or have Aboutalebi occupy the post from overseas.