A high-ranking former Iranian commander has sparked protests and angry denunciations by hard-liners and Revolutionary Guard leaders for publishing a commentary that critics said compares recent government crackdowns on the opposition to repression during the rule of the shah.

Retired Rear Adm. Hossein Alaei, the founder of the Revolutionary Guard’s navy and the only Iranian commander ever to have led a direct battle with the United States, triggered the furor with an open letter published Jan. 9 in the state-run Ettelaat newspaper.

In response, angry mobs besieged Alaei’s house Saturday, shouting slogans in support of Iran’s supreme leader, Ayatollah Ali Khamenei, and spray-painting the walls. The protests prompted Alaei to publicly express regret over writing the open letter, which was intended to commemorate the uprising 34 years ago that led to Iran’s Islamic revolution and overthrow of Shah Mohammad Reza Pahlavi. He also denied that he intended to compare Khamenei with the shah.

In the commentary, Alaei, who in 1988 led a two-day battle with the U.S. Navy in the Persian Gulf, urged Iran’s leaders to learn from the past in dealing with dissent. The retired admiral remains well connected within Iran’s establishment and teaches at the Revolutionary Guard’s Imam Hussein University in Tehran.

While the open letter did not directly mention the arrest of opposition figures and the crackdown that followed mass protests against Iran’s leaders in 2009, Alaei pondered questions that the shah might have asked himself in reflecting on his miscalculations in handling a wave of discontent, which ultimately forced him to flee Iran in January 1979.

“Wouldn’t the affair have ended there if I had allowed for the people to hold peaceful protests?” Alaei wrote, imagining the shah’s thoughts. “If instead of accusing opponents of acting against national security I had accepted the opposition, recognized it as legal and guaranteed their rights, could I not have stayed in power longer?”

Alaei ended his open letter by citing a verse from the Koran and tacitly warning leaders: “So learn a lesson, those who have vision!”

In Iran, where open criticism of the Islamic Republic’s top leaders is rarely published, many readers perceived Alaei to be deliberately comparing the last days of the shah with the current struggle of the country’s leadership to deal with growing discontent among the urban middle class.

Since his commentary was published, Alaei has written two more open letters accusing foreign media of twisting his words. Nevertheless, his original letter has set an agenda.

Ali Motahari, an outspoken politician who is still accepted by Iran’s leaders because his father was a renowned Shiite Muslim cleric, said the essay raised important questions for Iran’s future.

“Are our people in our country permitted to say that the way the election protests in 2009 were handled was not appropriate?” Motahari asked on the Tabnak Web site. “Or is it that, because of having an ‘Islamic’ prefix in our political system, whatever has been done was correct? If it so, it means we can never have changes in our system.”

Staunch supporters of the system responded angrily.

In a rare show of public criticism of a fellow senior officer, a group of 12 leading Revolutionary Guard commanders accused Alaei of attacking Khamenei.

“What has happened that you write a black line on the white pages of our jihad?” the commanders wrote in a letter to Alaei published Saturday by the semiofficial Fars News Agency. “While all the Muslim and freedom seekers of the region look at the Islamic revolution, and their wish is to kiss the arm of the leader, you are busy with scratching this sophisticated face and creating doubts in the divine path.”

The commanders concluded: “The enemy has taken you captive.”

The elite Revolutionary Guard Corps, which has more than 150,000 troops, is officially charged with defending the Islamic revolution. But it effectively acts as a protection force for the county’s leadership and defends the interests of hard-liners in Iran’s political system.

While the Obama administration often portrays the Revolutionary Guard as the primary unified force among Iran’s increasingly fragmented factions, its middle and lower ranks are just as affected by the country’s worsening economic situation as civilians.

Former commanders are among President Mahmoud Ahmadinejad’s harshest critics, while some widows of prominent slain Guard generals openly support the opposition movement, joining its calls for more personal freedoms, greater democracy and better relations with other countries.

In response to the Guard commanders, Alaei said Sunday that it was never his intention to criticize the supreme leader in his open letter.

“I spent all my life opposing despotism,” Alaei wrote. “Any comparison between the [former] imperial system and the Islamic Republic system is a false analogy.”