NEW YORK -- Thousands of Iranian-Americans gathered outside the United Nations on Wednesday to voice their opposition to the Iranian government, in the largest such protest here in 30 years.

The protesters' affiliations varied from royalist to communist, but they shared one thing: They don't consider Mahmoud Ahmadinejad, declared the winner of disputed presidential elections in June, to be Iran's legitimate leader.

Demonstrators rally against the government of Iran and President Mahmoud Ahmadinejad on Wednesday near United Nations headquarters in New York. Associated Press

"Freedom for Iran, justice for Iran," and "Free political prisoners," shouted the protesters convened here for Mr. Ahmadinejad's appearance at the United Nations General Assembly. The crowd included prominent artists, scholars, human-rights activists and former Iranian lawmakers who have joined the opposition.

Most demonstrators displayed the color green -- the symbol of the opposition movement in Iran -- and some brandished pictures of young men and women killed in the violence that followed the disputed June vote.

The demonstration was a rare show of unity for a community that has traditionally stayed on the sidelines when it comes to politics. In previous years, smaller groups protested during the General Assembly, but they were often scolded by other Iranians for not being in touch with the reality inside the country.

But the June 12 election and the unrest that followed, which included killings and beatings of protesters that were caught on tape, shifted the tide. Iranians in exile -- there are estimated to be about a million in the U.S. -- have become increasingly vocal about Mr. Ahmadinejad's regime.

"The green movement now encompasses everyone inside and outside Iran who wants change and freedom for their country; this is a very positive development," said Akbar Attri, a prominent former student activist who fled to the U.S. in 2005 after several stints in jail in Iran.

The Iranian government has done its best to deflate the significance of the demonstrations in New York. Official news outlets reported that only a handful of demonstrators linked to the Central Intelligence Agency had shown up for the rally, and posted pictures of four people standing at a street corner.

Mr. Ahmadinejad's trip this year is lower-key than his previous visits. He is staying in New York for just two days, and, according to official Iranian news sites, meeting with 11 foreign news outlets and having dinner with a group of American students.

Outside Mr. Ahmadinejad's hotel, the Intercontinental Barclay in midtown, several hundred protesters gathered late into Wednesday evening, chanting "Murderer, come out." They shouted slurs at Iranians arriving at the hotel for a dinner hosted by Mr. Ahmadinejad and tried to prevent them from entering. Some guests covered their faces and hustled inside, while others appeared to have a change of heart and didn't go in.

Iranian-American and Jewish-American groups had petitioned the hotel not to host the Iranian delegation. The hotel said it doesn't comment on its guests for privacy reasons.

Write to Farnaz Fassihi at