TEHRAN, Iran — Crowds of demonstrators battled security forces armed with tear gas and batons during a surprisingly large anti-government protest in the Iranian capital Monday that drew inspiration from the recent popular uprisings in Egypt and Tunisia.

Dodging clouds of tear gas fired by police and pro-government militiamen, the protesters marched down a central boulevard and shouted slogans: “Death to the dictator,” “We are all together” and “Down with Taliban, in Cairo and Tehran.”

Witnesses at several positions along the route said vast throngs of people could be seen marching from Enghelab (Revolution) Square toward Azadi (Freedom) Square, overwhelming police efforts to stop them.

Dozens of protesters were arrested for participating in the banned rally, an opposition website reported. A similar demonstration, clashes and arrests were reported in the central Iranian city of Isfahan.

The gathering in Tehran appeared to be the most significant anti-government protest here since security forces cracked down on a series of massive demonstrations in 2009. The size of the crowd was difficult to estimate. Some witnesses said they believed it exceeded 200,000. The Associated Press said tens of thousands of people demonstrated.

Some demonstrators held green ribbons, the color of the opposition movement that sprang to life after President Mahmoud Ahmadinejad’s disputed election victory in 2009.

After the election, the movement staged widespread protests. Those protests were eventually stifled by security forces, including the Revolutionary Guards and the Basij militia, which are fiercely loyal to Iranian Supreme Leader Ayatollah Ali Khamenei. Two people were hanged and scores of opposition supporters jailed. The last mass protest was in December 2009.