Saudi Arabia arrested several agents of its Commission for the Promotion of Virtue and the Prevention of Vice on Tuesday after a video showing the men attacking a woman outside of Riyadh's Al-Nakheel Mall began to circulate on social media.

A video of the alleged attack surfaced two weeks ago. It appears to show a woman being chased and pushed to the ground by agents of the commission. The religious police shove back bystanders who try to intervene. In the video, one of the policeman can be heard telling a bystanding "I am protecting her from you," as the woman screams on the ground.

At the end of the video, parts of the woman's bare leg can be seen.

After the video emerged on social media, the incident became a matter of intense public debate in the kingdom. Some Saudi journalists defended the religious police, saying that the video showed the agents doing their job, and protecting the women from men outside the mall who were trying to flirt with them.

Mohammed al-Badiri, a popular cleric, wrote that the police were merely protecting the young woman from her brother, who had discovered her walking with another man.

"Will those who have cursed and insulted the religious police, who protected a woman from her brother after he discovered her out with a young man, retract their statements and apologise to the police?" he wrote.

But a security guard at the mall contradicted that version of events, telling the London-based Arabic newspaper al-Hayat that the religious police tried to intervene to prevent flirting between the women and some men outside the mall.

"The religious police hold the greatest responsibility for the incident," the guard said.

A friend of the woman who was attacked also spoke with al-Hayat, but withheld her name out of fear of retaliation. She said she was present for the incident, but told a different version of events. Both women were standing in front of the mall, she said, when the religious police tried to force her friends to cover their faces. When they refused, the officers started chasing them — eventually pushing one to the ground.

Over the past two weeks, an Arabic hashtag referring to the incident has taken off, and other bystanders have posted their own videos of the incident from other angles.

After two weeks of controversy, the Saudi Ministry of Interior decided to intervene. "With reference to the incident reported on social media and afterwards by other media, and the allegations of a physical assault by a member of the commission on one of the girls, those who were involved have been arrested pending further investigations into the violations," the ministry said in a statement on Tuesday. The Ministry also said that some officials in the Riyadh office of the Commission had already been disciplined. No names or specifics have yet been released.

The Commission for the Promotion of Virtue and the Prevention of Vice fields between 3,000-4,000 agents charged with enforcing Saudi Arabia's version of religious law, which, among other things, imposes strict dress codes on women and bans them from driving.

Human Rights Watch has repeatedly criticized the Saudi government for " systematic discrimination against women." The country's "guardianship system," which requires women to seek permission from a male relative before obtaining a passport, marrying, traveling, or accessing higher education, is one of the most world's most draconian constraints on women's freedoms.