TEHRAN — Hundreds of thousands of Iranians rallied on the streets Sunday to mark the 39th anniversary of the 1979 Islamic Revolution, just weeks after antigovernment protests rocked cities across the country.
Demonstrators burned American and Israeli flags, as well as images of President Trump, whose refusal to recertify the nuclear deal with world powers has riled Iranians. A few burned a white sheet reading ‘‘Barjam,’’ the Farsi acronym for the 2015 nuclear accord that Tehran signed with world powers.
Such activities commonly mark the anniversary, which commemorates the overthrow of US-backed Iranian Shah Mohammad Reza Pahlavi. That began a period of hostilities between Iran and the West, including an attack on the US Embassy in Tehran and the subsequent hostage crisis.
However, President Hassan Rouhani made a point to call for unity among Iran’s people across its political spectrum, from hard-liners backing the theocratic government to reformists demanding change.
‘‘When the Revolution took place, we pushed some off the revolutionary train that we should have not,’’ Rouhani told a massive crowd at Tehran’s central Azadi Square. ‘‘Today, we have to let them board the train again.’’
Rouhani didn’t specifically name those pushed aside, though the Islamic Revolution and its aftermath saw the Islamists surrounding Ruhollah Khomeini purge liberals, communists, and others.
More recently, Iran has put leaders of its 2009 Green Movement under house arrest, where they remain even today despite Rouhani’s pledges to free them.
In a separate development, an Iranian-Canadian university professor detained in Tehran has died in custody, activists and a family member said Sunday, marking the latest suspicious death of a detainee in Iran after a crackdown on dissent following nationwide protests.
They identified the deceased as Kavous Seyed-Emami, a 63-year-old professor of sociology at Imam Sadeq University in Tehran and the managing director of the Persian Heritage Wildlife Foundation.
His son and the New York-based Center for Human Rights in Iran say that authorities told Seyed-Emami’s family that he committed suicide in custody, something they described as suspicious following other detainee deaths.
Tehran prosecutor Abbas Jafari Dolatabadi confirmed the professor’s death on Sunday, saying he had been detained in an alleged espionage ring.
Rouhani’s comments Sunday appeared aimed as being a salve after antigovernment protests marred the start of the new year. The demonstrations initially focused on Iran’s poor economy despite the nuclear deal, but quickly spiraled into chants directly challenging Iran’s theocratic government.
In his speech, Rouhani promised more job opportunities and better economic condition in the near future. Meanwhile, dozens of hard-liners chanted: ‘‘Death to liars, death to the seditious!’’
Rouhani also suggested voters could push for a ‘‘referendum’’ in the country, without elaborating. Some abroad have argued for a referendum to push for an overhaul of Iran’s government.
‘‘It seems like a reaction to his hard-line opponents,’’ analyst Saeed Leilaz said. ‘‘It can be a warning to hard-liners that any further pressure against him can have broader repercussions.’’
Authorities arrested nearly 5,000 people in the crackdown that followed, according to Alireza Rahimi, an Iranian lawmaker. At least 25 people were killed in clashes surrounding the demonstrations, which largely were snuffed out with authorities blocking some social media apps and sending more security forces into the street.
Decades after the Islamic Revolution, Tehran has had successes abroad after years of turmoil. Iran helped push back the Islamic State group in Iraq and assisted embattled Syrian President Bashar Assad in regaining strategic ground in his country’s long civil war.
At home, however, the country’s economy still struggles despite the 2015 nuclear deal. The accord allowed Iran to begin selling its crude oil again on the international market, but rising food prices have squeezed the average Iranian while salaries remain stagnant and unemployment high.
A January survey by the Center for International and Security Studies at the University of Maryland and the Toronto-based firm IranPoll found that 58.4 percent of those interviewed said they found the country’s economy was getting worse.
Nearly 70 percent said they found Trump to be ‘‘completely hostile’’ toward Iran. The telephone-interview survey of 1,002 Iranians had a margin of error of 3.1 percent.
The economic protests still were on people’s minds Sunday even at a progovernment rally.
‘‘Look at these people, they have come in massive numbers here though they know there are some economic problems, too,’’ said Samaneh Heidari, a 29-year-old teacher wearing a black chador. ‘‘We are here to show support to the revolution, it’s bigger than any kind of opposition.’’