Iranian and Afghan social media users are united in condemning a move by a senior Iranian provincial official to expel all Afghan refugees as racist and shameful.
Late last month, the deputy governor-general of Iran's northern Mazandaran Province, Hadi Ebrahimi, announced that all Afghans had to leave the province by 2 July, irrespective of their legal status.
"From that date, their residency and identity documents will no longer be valid," said Ebrahimi, according to the official Iranian news agency Irna.
The deputy governor, who is in charge of political and security affairs of the province, went on to warn employers that offering work or help to Afghans would be illegal.
"Any form of service or assistance [to Afghans] would be considered a crime and punishable by the full force of the law."
Mr Ebrahimi, whose province is on the Caspian Sea coast and is a popular tourist destination, reminded the public that the "presence of Afghans in 10 coastal towns" had been banned four years ago.
Moreover, he said that marriage between Iranian women and Afghan men had been deemed illegal in 2006.
"We should prevent this occurring by educating the public about the consequences of these marriages," he added, without elaborating.
'We are all Afghans'
Earlier last month it was reported that Afghans had been banned from attending a popular park in the historic Iranian city of Esfahan to mark the annual "Nature Day", celebrated by Iranians and Afghans alike.
A senior police official was quoted as saying that Afghans had been banned because "in previous years, a number of Afghans had caused insecurity".
"[The ban on Afghans] was put in place to ensure the safety and security of Iranian citizens," said Ahmad Reza Shafi'i of Esfahan police.
Iranian social media users were quick to react. Two Facebook pages appeared, both called "We are all Afghans".
One shows a background photo of three men holding placards saying "I too am an Afghan", and "no to racism".
The other page says it was set up by "Iranians opposed to ethnic discrimination against Afghan immigrants".
The moves against Afghan residents led many Iranians to express solidarity and empathy with the refugees. They included Asghar Farhadi, the Oscar winner and director of the internationally-successful film "A Separation".
Farhadi, who is in Paris preparing his next film, is set to travel to Iran next week to show solidarity with the Afghans.
"Such undignified behaviour against immigrants in Iran - a country which itself has one of the highest number of emigrants in other countries - leaves a bitter taste," he was quoted as saying.
"Blaming insecurity and unemployment on immigrants is shirking one's responsibility."
Other film makers and actors have also expressed solidarity with Afghans, including director Daryush Mehrjuyi and Leila Hatami, the female star of "A Separation".
Comments by Iranians on the Balatarin community website were indicative of the mood, with the vast majority condemning the Mazandaran provincial official for his expulsion order.
"Shameful, what can I say," said one.
"Let's hope Mazandaran gets cleansed from all racists," wrote another.
Other users praised Iranian artists for expressing empathy for the immigrant community.
"Thank God for these honourable artists," wrote "azadmard88".
"Well done to all of them," said "teaspoon".
Meanwhile, prominent Kabul-based journalist and blogger Razaq Mamoon took the international community to task for its perceived silence regarding the plight of Afghans in Iran.
"There isn't much to say about the Islamic Republic [of Iran]... and its fascist and racist acts against Afghan refugees," he wrote. "But the silence of governments and international bodies such as the UN once again gives the seal of approval to the fascism of the Islamic Republic."
Another Afghan blogger commented that the behaviour of some Iranians towards Afghans will backfire.
"The dignity of Afghans will not be reduced one iota," wrote Mohammadi. "It is you who will be crushed."
According to the Afghan Ministry of Refugee Affairs, there are some 2.3m Afghan immigrants living in Iran, but only 900,000 of them have legal residency papers.
Most Afghans escaped to Iran after the Soviet invasion of their country and the subsequent civil war and Taliban takeover. They are regularly threatened with forcible expulsion, and their plight has become a source of tension between Iran and Afghanistan. But the long and porous border between the two countries has so far made it impossible for Iran to expel Afghan immigrants.