The professor of artificial intelligence was a rising star at Iran’s elite Sharif University of Technology. He gained wider fame for his vocal support of the women-led uprising that rocked Iran last year. At one point, he refused to teach until Sharif students arrested in the government’s crackdown against protesters were released.

But speaking up came with a cost — last week, Ali Sharifi Zarchi lost his job, becoming one of at least 15 academics expelled from Iranian universities in the past few weeks because they supported the uprising.

The purging of academics like Mr. Sharifi Zarchi is part of a wide and intensifying crackdown by the government before the anniversary of the start of the uprising this month. In the past few weeks, Iran has arrested women’s rights activists, students, ethnic minorities, an outspoken cleric, journalists, singers and family members of protesters killed by security agents.

Security agents have been contacting relatives of the victims and demanding they remain silent, a group of the families said in a statement posted on Instagram, pledging, “We will resist until the end.” Amnesty International released a report last week documenting 22 cases of government harassment of families of killed protesters, including damaging the graves of their loved ones.

“The threshold of what constitutes an offense that gets one arrested has gone to an unexpected level,” said Tara Sepehri Far, an Iran researcher for Human Rights Watch. “They are trying to make sure at all costs that nothing happens around the anniversary. It shows how nervous they are about the growing frustration and discontent.”

The uprising erupted after a young woman, Mahsa Amini, was arrested by the country’s feared morality police and accused of failing to wear her hijab in accordance with the law. She died in police custody on Sept. 16. Her death set off nationwide protests for nearly six months and a movement, led by women and young girls, for wholesale democratic change in Iran.

Iran’s most prominent women’s rights activist, Narges Mohammadi, who is serving a 10-year sentence for “spreading anti-state propaganda,” said physical violence was increasing against women in prison before the anniversary.

“We have seen women and girls entering prison with bruised and injured faces and bodies,” she wrote in a letter posted on Instagram on Aug. 17. The injuries included fractured cheekbones, rib pain, blows to the head and bruises, she said.

A senior judiciary official, cited by official news media, said Iran’s enemies were plotting unrest for the anniversary and that security and intelligence agents were monitoring any activity related to dissent. He vowed that protesters would be shown no mercy.

“The judicial system will deal with these people decisively,” said Sadegh Rahimi, the deputy head of the judiciary, according to the Iranian news media. He warned that the thousands of protesters arrested and released after the supreme leader, Ayatollah Ali Khamenei, issued an amnesty in February would face severe punishment if they continued to protest. “This means that their punishment will be doubled, and no concessions will be applied to them,” he said.

Activists have called for protests to mark the anniversary of Ms. Amini’s death, although it’s still unclear how many people will turn out for rallies. The next few months will see a string of anniversaries marking that crackdown, in which at least 500 protesters, many of them teenagers and children, were killed, and seven were executed. Each date will renew the collective trauma and grief and carry the potential for unrest, the activists say.

Many Iranians mourned the sudden death of a 35-year-old protester, Javad Rouhi in prison on Thursday. Mr. Rouhi was sentenced to death on allegations of “leading riots” and inciting violence during the protests, but Iran’s Supreme Court overturned his sentence after an appeal. The local prosecutor said he had fallen ill and that the cause of his death was under investigation, according to local news media. Rights groups said he had been tortured in prison.

“The regime feels it has to assert itself or a new wave of protest will sweep across the country,” said Hadi Ghaemi, the executive director of the Center for Human Rights in Iran, a New York advocacy group. Mr. Ghaemi said many ordinary Iranians had shown an appetite for using any opportunity to air their grievances. In August, the Shiite religious ritual Ashura, attended by religious conservatives, became a new platform for anti-government protests across the country.

A popular pop singer, Mehdi Yarrahi, 42, was arrested on Monday at his home in Tehran. He recently released a song praising the growing number of women across Iran who have been rejecting the hijab and showing their hair in a collective act of civil disobedience.

The judiciary said Mr. Yarrahi had released an “illegal song” that defied the “morals and norms of an Islamic society.” The rapper Dorcci, 32, was also arrested this week after his song “Damn Things” — in which he condemns power abuses, corruption and the struggles of everyday life — went viral with over 20 million views.

Many young Iranians are posting videos of themselves dancing to the two songs and singing the lyrics to protest the artists’ arrests.

The targeting of professors in the universities has also ignited a wide backlash, even from former officials. In a meeting with former cabinet members, former President Hassan Rouhani called it “an injustice to science and the country” and said it was counterproductive. But the government defended the decision, with the ministry of the interior issuing a statement calling it “a revolutionary duty worthy of praise.”

The newspaper Etemad reported on Thursday that at least 50 faculty members had been expelled, banned from teaching or forced into retirement in the past year. They had supported protests for democratic change and criticized the government repression targeting their students.

On Thursday, the computer engineering department at Sharif University of Technology issued a statement demanding that the decision to fire Mr. Sharifi Zarchi, the A.I. professor, be reversed. A student-led petition to reinstate him has received more than 6,000 signatures.

Mr. Sharifi Zarchi announced his dismissal in a social media post on Aug. 26 that included a verse from a Persian poem about showing defiance in the face of intimidation.

Sharif University of Technology, a magnet for Iran’s brightest minds and a recruiting ground for elite American universities such as the Massachusetts Institute of Technology, was the target of a violent raid that shocked Iran last October.

Ghazal, a 22-year-old college student who attends an art school and asked that her last name not be used for fear of retribution, said four professors of design at her university had been fired and replaced with instructors who taught Islamic texts. She said the intimidation of students and firing of professors has contributed to an oppressive environment, just as the academic year is set to start at the end of September.

“These religious professors know nothing about specialized courses. Most of us are thinking about how to leave Iran and not study here. I don’t even know if I want to finish my degree,” Ghazal said.

Many of the professors have reacted to the crackdown with defiance.

“We teachers cannot obey governments and be submissive,” Ameneh Aali, a professor of psychology at Allameh Tabataba’i University who was among those dismissed, said in an open letter posted on social media. Dr. Aali said she had been interrogated by the ministry of intelligence multiple times over the past year. “Us teachers are indebted to the people and must serve them.”

Leily Nikounazar contributed reporting.