That is what this Tehran Bureau report suggests. Brian Ulrich thinks this makes sense:
A coup that originated with the military rather than the clerical or lay political leaders resolves what I saw the the main flaw with Juan Cole's reconstruction. It also dovetails well with Interior Ministry employees' warnings that Ayatollah Mesbah-Yazdi, who is influential in the military, issued a fatwa authorizing manipulation of the elections. A coup led by the military is also easier to explain than one ordered by Ayatollah Khamene'i. I had been thinking about the implications of a Mousavi victory, and concluded that, given the continuing conservative dominance of Parliament, the most important changes for Iranians would be a different economic policy and the replacement of someone hostile to the old revolutionary establishment embodied by the likes of Rafsanjani with someone who was actually a part of it.