Helping to pass the constitution, suppress moderates and otherwise radicalize the revolution was the holding of 52 American diplomats hostage for four hundred forty-four days. In late October 1979, the exiled and dying Shah was admitted into the United States for cancer treatment. In Iran there was an immediate outcry and both Khomeini and leftist groups demanding the Shah's return to Iran for trial and execution. On November 4, 1979 youthful Islamists, calling themselves Muslim Student Followers of the Imam's Line, invaded the embassy compound and seized its staff. Revolutionaries were reminded of how 26 years earlier the Shah had fled abroad while the Embassy-based American CIA and British intelligence organized a coup d'état to overthrow his nationalist opponent.
The holding of hostages was very popular and continued for months even after the death of the Shah. As Khomeini explained to his future President Banisadr,
This action has many benefits. ... This has united our people. Our opponents do not dare act against us. We can put the constitution to the people's vote without difficulty ...
With great publicity the students released documents from the American embassy or "nest of spies," showing moderate Iranian leaders had met with U.S. officials (similar evidence of high-ranking Islamists having done so did not see the light of day). Among the casualties of the hostage crisis was Prime Minister Bazargan and his government who resigned in November unable to enforce the government's order to release the hostages.
The prestige of Khomeini and the hostage taking was further enhanced with the failure of a hostage rescue attempt, widely credited to divine intervention.
It ended with the signing of the Algiers Accords in Algeria on January 19, 1981. The hostages were formally released into United States custody the following day, just minutes after the new American president Ronald Reagan was sworn in. The hostages had been held at the U.S. embassy in Tehran for 444 days.