A shocking video of a mob beating in northern Afghanistan has provided a window into the brutal "justice" women in the country can face.

Footage of the incident, which reportedly took place in December in Takhar Province, only recently emerged on social media.

It shows a woman clad in a blue burqa kneeling as she is shouted at and insulted by a crowd of men that included family members.

As she kneels, she receives heavy blows to her head, back, arms, and shoulders by multiple stick-wielding men.

The woman is silent throughout the beating, as shouts of "Allahu Akbar" can be heard from the crowd. At one point, a man kicks her in the back, causing the woman to fall to the ground. When she gets back on her knees, the beating continues.

Witnesses have claimed that the 22-year-old woman was being punished at the order of local clerics, who had decided she was guilty of having an extramarital affair while her husband was away in Iran.

Sonatollah Teymour, the spokesman of Takhar’s governor, told RFE/RL’s Radio Free Afghanistan that relatives had found the woman alone with a 17-year-old boy.

"A young man had entered the woman's house and he had been there for three hours," Teymour said. "The relatives found out and discovered the woman and the boy alone."

'Mob Justice'

Teymour said the woman was a relative of a local warlord who was present during the beating. The woman’s father-in-law and other male relatives took part in the beating, he added. The unidentified woman, he said, survived the attack and now lives with her husband in the village of Chahab.

Teymour said authorities have ordered those involved in the punishment to be arrested and brought to justice.

Bilal Siddiqi, spokesman for Afghanistan's Independent Human Rights Commission, has called on the government to find those involved in the beating as soon as possible.

“We’re concerned and we hope that the government will take steps to strengthen the rule of law and prevent mob justice,” Siddiqi told RFE/RL’s Radio Free Afghanistan.

The woman's ordeal is not uncommon in Afghanistan. In recent years there have been several reports of women facing public punishment for alleged moral crimes.

The most prominent was the violent death of 27-year-old Farkhunda Malikzada, who was beaten to death by a mob in Kabul after being falsely accused of burning a copy of the Koran.

Her death in March 2015 prompted a national outcry and an outpouring of anger in the country.