On the basis of what we know so far, here is the sequence of events starting on the afternoon of election day, Friday, June 12.
Near closing time of the polls, mobile text messaging was turned off nationwide Security forces poured out into the streets in large numbers The Ministry of Interior (election headquarters) was surrounded by concrete barriers and armed men National television began broadcasting pre-recorded messages calling for everyone to unite behind the winner The Mousavi campaign was informed officially that they had won the election, which perhaps served to temporarily lull them into complacency But then the Ministry of Interior announced a landslide victory for Ahmadinejad. Unlike previous elections, there was no breakdown of the vote by province, which would have provided a way of judging its credibility The voting patterns announced by the government were identical in all parts of the country, an impossibility (also see the comments of Juan Cole at the title link) Less than 24 hours later, Supreme Leader Ayatollah Khamene`i publicly announced his congratulations to the winner, apparently confirming that the process was complete and irrevocable, contrary to constitutional requirements Shortly thereafter, all mobile phones, Facebook, and other social networks were blocked, as well as major foreign news sources.
All of this had the appearance of a well orchestrated strike intended to take its opponents by surprise the classic definition of a coup. Curiously, this was not a coup of an outside group against the ruling elite; it was a coup of the ruling elite against its own people.