Nine men in traditional Afghan clothing stand in line against a brick wall as a man in an Iranian police uniform wields a long stick.
"Why did you come here," he shouts as he works his way down the line, slapping each of the nine in turn.
The uniformed man then repeatedly orders the men to do squats, as another man can be heard laughing behind the camera.
While the authenticity of the 45-second clip uploaded on social media this week has not been independently verified, the video has prompted a strong reaction in Kabul, where officials have long complained of mistreatment and discrimination against the estimated 1 million Afghan migrants and refugees who reside in the Islamic republic.
"This is shameful and disgusting, to say the least," Afghan Deputy Foreign Minister Idrees Zaman said on December 18. "We are going to raise the issue with Iranian officials. We will not allow Afghans to be treated like this."
In a statement carried by the semiofficial ILNA news agency, Iran's police force rejected the allegation that an officer had assaulted a group of Afghan nationals.
"Immediately after the release of this video an investigation was launched, and it became clear that this incident did not occur on police premises," said the statement, which added that police were to identify and arrest "perpetrators who produced this film."
In statement published by Iran's semiofficial news agency ISNA on December 19, the Iranian Embassy in Kabul said that "it strongly denounced this inappropriate behavior." The embassy said an investigation had been launched into the incident.
In 2016, the Afghan government protested a decision by authorities in the Iranian city of Shiraz to put arrested, blindfolded Afghan refugees on display. Iranian media published a series of photographs of Afghans – who had been detained on suspicion of illegally entering the country -- sitting behind barricade fences wearing white blindfolds.
Human Rights Watch has documented violations against Afghan refugees and migrants in Iran, including physical abuse, detention in unsanitary and inhumane conditions, forced payment for transportation and accommodation in deportation camps, forced labor, and forced separation of families.
The New York-based group has also said Iran's powerful Islamic Revolutionary Guards Corps (IRGC) has recruited thousands of undocumented Afghans living there to fight for pro-Iranian militias in Syria since 2013.
The United Nations estimates the number of Afghan citizens in Iran at just under 1 million, many of whom claim to face violence and injustice in the Islamic republic. Tehran puts the figure of documented and undocumented Afghan refugees and migrants at closer to 3 million.
For decades, Afghans have turned to Iran to earn a living despite widespread reports of migrants facing violence and injustice there.
Tehran has expelled many Afghans, who are often blamed for insecurity and unemployment in Iran, and periodically threatens those who remain with mass expulsions.
Many of them moved to Iran following the Soviet occupation of Afghanistan and the civil war that followed the Soviet withdrawal. Others sought refuge in Iran after the Taliban took power in Afghanistan.
Many have taken on menial work that is of little interest to Iranians.
In 2015, Iranian Supreme Leader Ayatollah Ali Khamenei issued a decree allowing all Afghan children to receive an education. But Afghans are still denied basic services, including access to health care, jobs, and even housing.