Ever since oil was discovered in Iran in the first decade of the 20th century, the country had attracted great interest from the West. British corporations controlled the majority of Iran’s petroleum by the early 1950s, when newly elected Prime Minister Muhammad Mossadegh announced plans to nationalize the country’s oil industry. Worried that Mossadegh was moving Iran closer to the Soviet Union, the Cold War-era Central Intelligence Agency (CIA) and British intelligence conspired to overthrow Mossadegh and consolidate power under a leader who was more receptive to Western interests.

That leader, a member of Iran’s royal family named Mohammed Reza Shah Pahlavi, was installed in power in 1953. Under the Shah’s pro-Western, secular anti-communist government, some 80 percent of the nation’s oil reserves returned to U.S. and British control. With a steady supply of American-made weapons, the Shah and SAVAK, his secret police, brutally repressed opposition to his rule, including an uprising in 1963 led by the Ayatollah Ruhollah Khomeini, an elderly Islamic cleric.

WATCH: Desert One on HISTORY Vault 

Finally, in 1979, a popular revolution in Iran swept the Shah from power, replacing him with an Islamist government engineered by Khomeini, who returned triumphantly after 14 years of exile to take his place as Iran’s political and religious leader. U.S. President Jimmy Carter, against the advice of some of his advisers, declined to act in support of the Shah, but also failed to reach out to the opposition—a decision that would cost him dearly. That October, after it was announced that the Shah, now in exile in Mexico, was suffering from an aggressive form of cancer, Carter reluctantly decided to allow him entrance to the United States for treatment on humanitarian grounds.

The decision sparked a firestorm of anti-American sentiment in Iran, culminating in the students’ siege on the U.S. embassy in Tehran on November 4. The Iran hostage crisis would bring the United States to a state of near war with Iran and torpedo Carter’s presidency. After a short time, the students released 13 of the 66 hostages, who were mostly diplomats and employees at the embassy. Those released were mostly women, African Americans and non-U.S. citizens, whom (according to Khomeini) were already subject to the “oppression of American society.” Though another hostage was later released due to health problems, 52 men and women remained in captivity by mid-summer of 1980.

storming of embassy
Getty Images / AFP
Iranian students climb the walls of the U.S. embassy in Tehran on November 4, 1979.

President Carter made freeing the hostages in Iran the top priority of his administration, but neither diplomatic overtures nor economic sanctions swayed the Ayatollah and his supporters. In April 1980, a military operation involving an elite rescue team failed after a helicopter crashed into a transport plane, killing eight servicemen. Amid constant media coverage, Carter’s failure to resolve the hostage crisis doomed his 1980 reelection campaign, as Republican challenger Ronald Reagan benefited greatly from Carter’s increasing weakness. (Rumors even circled that Reagan campaign staffers negotiated with the Iranians to ensure that the hostages were not released before election, but Reagan would vigorously deny these allegations.) In November 1980, Reagan won a landslide victory.

Getty Images / H. KOTILAINEN / Staff
<em>The first group of released U.S. Embassy staffers address the media on November 18, 1979</em>

Meanwhile, the embassy hostages lived in deep uncertainty and fear, subjected to long periods of confinement, beatings, threats of bodily harm and execution. Among other privations, their captives deprived them of hot and cold running water until days before their release. After months of negotiations, the United States and Iran finally came to an agreement to free the hostages in December 1980, but the Iranians showed their enduring hatred of Carter by waiting to release them until minutes after Reagan delivered his inaugural address on January 20, 1981.

The Iran hostage crisis brought the United States directly into conflict with militant, political Islam for the first time. It also began the hostility that continues to characterize the U.S. relationship with Iran to this day. In Tehran, the former embassy building, which served as a prison for the hostages over those agonizing 444 days, is now an Islamic cultural center and museum. Known in Iran as “the den of spies,” it has become a symbol of the Iranian revolution.