Sen. Ted Cruz, R-Texas. (J. Scott Applewhite/AP)

A measure that would bar Iran’s recently appointed ambassador to the United Nations from entering the United States easily passed the Senate on Monday, delivering a rare legislative victory for its lead sponsor, Sen. Ted Cruz (R-Tex.).

Cruz, a first-term senator who is considering a run for president in 2016, has spent the last several days railing against Iran’s appointment of Hamid Aboutalebi as its new top envoy to the United Nations in New York.

Aboutalebi was a member of the student group that led the 1979 seizure of the U.S. Embassy in Tehran. He has acknowledged that he worked with the organization that took over the embassy, but has played down his role in the crisis.

Aboutalebi’s appointment by Iranian President Hassan Rouhani has been criticized by the Obama administration, which called the nomination “extremely troubling.” In recent months, Aboutalebi’s visa application to enter the United States as a diplomat has been stalled. As host nation of the United Nations’ headquarters, the United States generally admits the chosen representatives of U.N. members, with limited exceptions.

“We’re taking a close look at the case now, and we’ve raised our serious concerns about this possible nomination with the government of Iran. I’m not going to get into specifically how we’ve done that, but we have done that,” State Department spokeswoman Marie Harf said at a news briefing last week.

The Cruz bill passed unanimously Monday evening and will require House approval and President Obama’s signature to take effect. An aide to Rep. Doug Lamborn (R-Colo.), who has authored a similar bill in the House, said the congressman was working with Cruz to move the proposal quickly through that chamber. Leadership aides in the GOP-controlled House did not immediately respond to requests for comment about the bill’s prospects.

A deal to approve Cruz’s bill quickly materialized over the weekend, aides said, when the senator from Texas spoke with Sen. Charles E. Schumer (N.Y.), the chamber’s third-ranking Democrat, who also has been pushing aggressively for sanctions against Iran and for the Obama administration to block the granting of a visa to the new envoy.

In a deeply divided Senate, the idea of Cruz and Schumer — two often-intense partisans — working together on anything is almost fanciful. But aides to both senators said that during their conversation Schumer said Cruz’s bill would probably be able to come to the floor without Democratic objections. Cruz agreed to make changes that would require that targets of the legislation must be found by the State Department to have participated in terrorist activities before they can be barred from entering the country, aides said.

The conversation came after both senators expressed their opposition last week to Aboutalebi’s appointment. In a speech, Cruz said: “It is unconscionable that in the name of international diplomatic protocol the United States would be forced to host a foreign national who showed a brutal disregard of the status of diplomats when they were stationed in his country. This person is an acknowledged terrorist.”

And in a letter sent to Secretary of State John F. Kerry, Schumer described Aboutalebi as “a major conspirator” in the Iran hostage crisis and said his nomination to represent Iran at the United Nations “is a slap in the face to the Americans that were abducted, and their families; it reveals a disdain for the diplomatic process and we should push back in kind.”