After the failed rescue attempt, the United States was left with only diplomacy as a weapon to secure the release of the hostages. Unfortunately, the rescue attempt seemed to strengthen the resolve of the Iranians and talks stalled or were met with negative responses. The crisis drug on.
A series of events unfolded which would lead to the release of the hostages. First, Ronald Reagan won the 1980 Presidential election. He had pledged to bring the hostage crisis to an end quickly once in office. His election as President made many students and the Ayatollah on edge, wondering what type of action he may employ.
Second, supporters of the Ayatollah had won the majority of seats in the parliament. There was not much political capital left by holding the hostages.
Another issue was the war Iran had become involved in with Iraq. The Iranians would need the assets frozen in the United States in order to fund the war.
Lastly, the Shah had died in July of 1980 while living in Egypt. The primary demand of the students was the return of the Shah. This was now impossible.
A deal was struck between the United States and Iran, using Algerian diplomats to resolve the crisis. The United States agree to unfreeze Iranian assets and also agree to a stipulation not to meddle in Iranian affairs. In return, the remaining 52 hostages would be returned.
The Algiers Accord Link to the actual document.
The Ayatollah would wait until the swearing on of President Reagan before releasing the hostages. The Ayatollah stated that he wanted to further humiliate President Carter and also show the world that Iran could have an affect on U.S. elections.
The hostages were released moments after the swearing in of President Reagan.