Thousands of Iranians burned the American flag and chanted slogans Wednesday as they marked the anniversary of the seizure of the U.S. Embassy in Tehran by militant students 36 years ago.

The annual state-organized rally drew greater attention this year, as Iranian hard-liners look to counter moderate President Hassan Rouhani's outreach to the West following a landmark nuclear deal reached with world powers in July. An Iranian official also chose the occasion to announce the arrest of an unspecified number of allegedly pro-American writers.

The hard-liners fear Rouhani's efforts to improve relations will pave the way for the United States to undermine and eventually dismantle the Islamic republic formed after the 1979 revolution.

On Nov. 4, 1979, militant students stormed the U.S. Embassy compound and took 52 Americans hostage after Washington refused to hand over the toppled U.S.-backed shah, Mohammad Reza Pahlavi, for trial in Iran. The students held the hostages for 444 days, and the two countries have had no diplomatic relations since then.

Protesters on Wednesday carried placards reading "political and security penetration is forbidden." They pumped their fists in the air, shouting "God damn America," and "No compromise, no surrender to U.S."

More On This...

Others carried banners rejecting U.S. fast food chains McDonald's and Starbucks. Authorities recently closed a newly opened knock-off of KFC, saying it was unlicensed.

Hard-liners view fast food outlets and other American products as part of a "cultural invasion" by the U.S. aimed at undermining Islamic rule and public morality.

Foreign firms are poised to return to Iran following the lifting of international sanctions under the nuclear deal, but it remains unclear whether American brands will be allowed in.

Iran's state TV showed similar demonstrations in other Iranian cities to mark the occasion, known as the "National Day against Global Arrogance."

Wednesday's rally in Tehran also saw State Prosecutor Ebrahim Raeisi announce that the intelligence department of the elite Revolutionary Guard had detained a number of writers.

"The intelligence and security forces identified and cracked down on a network of penetration in media and cyberspace and detained spies and writers hired by Americans," he told the rally, without elaborating.

"Under no circumstances will we allow penetration of Americans in economic, social and cultural areas," he added.

Iran has arrested a number of activists, journalists and artists since Rouhani's 2013 election and currently holds four Iranians with U.S. citizenship, including a Washington Post reporter. Analysts say the arrests are the work of hard-liners in the judiciary and the security forces.