Minutes after Ronald Reagan’s inauguration as the 40th president of the United States, the 52 U.S. captives held at the U.S. embassy in Teheran, Iran, are released, ending the 444-day Iran Hostage Crisis.

On November 4, 1979, the crisis began when militant Iranian students, outraged that the U.S. government had allowed the ousted shah of Iran to travel to New York City for medical treatment, seized the U.S. embassy in Teheran. The Ayatollah Khomeini, Iran’s political and religious leader, took over the hostage situation, refusing all appeals to release the hostages, even after the U.N. Security Council demanded an end to the crisis in an unanimous vote. However, two weeks after the storming of the embassy, the Ayatollah began to release all non-U.S. captives, and all female and minority Americans, citing these groups as among the people oppressed by the government of the United States. The remaining 52 captives remained at the mercy of the Ayatollah for the next 14 months.

President Jimmy Carter was unable to diplomatically resolve the crisis, and on April 24, 1980, he ordered a disastrous rescue mission in which eight U.S. military personnel were killed and no hostages rescued. Three months later, the former shah died of cancer in Egypt, but the crisis continued. In November 1980, Carter lost the presidential election to Republican Ronald Reagan. Soon after, with the assistance of Algerian intermediaries, successful negotiations began between the United States and Iran. On the day of Reagan’s inauguration, the United States freed almost $8 billion in frozen Iranian assets, and the hostages were released after 444 days. The next day, Jimmy Carter flew to West Germany to greet the Americans on their way home.

READ MORE: How the Iran Hostage Crisis Became a 14-Month Nightmare for President Carter and the Nation