Embassy personnel were aware of a planned demonstration by Iranian students on November 4th, 1979. The students were to march past the U.S. Embassy on the way to the University of Tehran for a demonstration.
Unknown to Embassy personnel, the demonstrators planned to breach the Embassy Compound. The leaders of the demonstration figured they would be fired upon and counted on people being killed. They could use this as propaganda and could further fuel ant-american hate. While passing the Embassy, the crowd began climbing walls to the compound and forcibly broke the embassy gate.
Facing little to no resistance from the personnel in the compound, the Iranians were able to take hostage all personnel in the compound. A total of 63 Americans were taken hostage. At the time of the siege, there were several personnel off the embassy grounds.
Due to the surprise nature of the attack and also a shortage of personnel, proper protocol was not able to be followed by personnel. Many documents and other sensitive material was unable to be destroyed, leaking secrets to the Iranians.
The Iranians cited allowing the Shah into the United States as the primary reason for the takeover. Additionally, information gleaned from improperly disclosed documents and materials provided the Iranians with information that would further justify, in their minds, the embassy takeover.
The initial demand was the return of the Shah from the United States to Iran. It was clear, if that were to happen, he would be executed.