On November 4, 1979, students and other protesters in Iran took control of the United States embassy in Tehran and held the seventy Americans there hostage for 444 days. For over a year, the United States and the Carter Administration seemed helpless to do anything for those being held. It was not until the inauguration of President Ronald Reagan that the crisis was resolved.
For years, the United States had supported a hereditary Shah as the leaders of Iran. In exchange for assurances that Iran would not naturalize the oil industry and that the supply of oil to the West would not be cut off, the United States gave the Shah economic and military aid. The Shah used this aid and the profits from Iran's oil industry to buy weapons and crush opposition to his rule.
Beginning in the 1960s, the Shah and began allowing more and more economic and social freedom to the people of Iran, but he continued to deny them political freedom. His refusal to allow political freedom, his continued cooperation with the West, his westernization of Iran, and his military build-up lost the Shah the support of the Iranian people. In 1963, the Iranian government had to violently suppress rioting. It arrested and exiled many religious nationalists including the Ayatollah Ruhollah Khomeini.
By 1979, however, opposition to the Shah and his rule had grown to such an extent that the Shah was forced to flee the country on January 16th. His rule had been overthrown by a popular revolution of ordinary Iranians, including nationalists and religious conservatives. In February of that year, the Ayatollah Ruhollah Khomeini returned from exile and took leadership of Iran. Unlike the Shah, Khomeini had no desire to work with the West and his efforts at anti-American agitation among the Iranian people were largely successful.
Thus, many Iranians were enraged when the United States allowed the exiled Shah to travel to the US for cancer treatment. On November 4th, several hundred militant students attacked the US embassy in Tehran and quickly overran it. They took the seventy or so Americans inside hostage, quickly released some women and minorities, but kept the rest hostage for 444 days. An attempt by the Carter administration to rescue the hostages by force ended in failure with the deaths of eight US servicemen.
Eventually, the death of the Shah and the Iran-Iraq war made the Iranians more willing to discuss a peaceful end to the negotiations. In its final days, the Carter administration was able to negotiate the release of the hostages, but the agreement did not take effect until a few minutes after President Reagan was sworn in as President. The feeling that many had is that the militants were actually afraid of Reagan and thought he might take a more aggressive stance than Carter had.