The enormous scale of Russia's Olympic security apparatus has been well documented — 40,000 armed forces, 11,000 closed circuit cameras, and an all-powerful electronic surveillance system, all designed to prevent terrorist attacks and domestic unrest at the Winter Games. So far, though, the forces making headlines out of Sochi aren't armed policemen or military guards, but Cossacks: a group of deeply traditional militiamen who are seen as both Olympic mascots and vigilante crusaders, enforcing the kind of conservative moral code that has become a cornerstone of President Vladimir Putin's domestic agenda.

On Wednesday, at least 10 Cossacks and suspected plainclothes officers attacked members of the punk collective Pussy Riot in downtown Sochi, where the group was shooting a music video for a new protest song. Brandishing horsewhips and pepper spray, the men struck several women in the band, forcing one to the ground and forcibly removing their trademark neon-colored ski masks. A member of Pussy Riot's entourage later said that the men told them to "shut their mouths" and that they "sold themselves to the Americans."

Images and footage of the incident quickly spread across the media, marking the latest in what many see as the Kremlin's ongoing crackdown on dissent. It also shed new light on modern-day Cossacks, who have played an increasingly prominent role in policing gay rallies and stoking nationalist sentiment — all under the tacit, if not explicit, consent of Russian authorities.

The Cossacks' precise origins remain an issue of debate among historians, though they have a long history of keeping order in Russia. They first emerged as a warrior–horseman class during the Middle Ages and eventually became an integral part of the czarist military regime, expanding the Russian Empire with conquests along its southern border and quashing uprisings from peasants and workers. Many Cossack groups were nearly wiped out by the ruling Bolsheviks after the Russian Revolution, though they've enjoyed something of a revival in post-Soviet Russia. And with their traditional fur hats and lead-weighted whips, they still carry resonance among Russia's more conservative factions, as symbols of moral discipline and fierce loyalty to the regime.

Today's Cossacks comprise something of a paramilitary class, operating as a type of auxiliary police force. Their traditional ideology, rooted in the Russian Orthodox Church, appears to have resonated with Russian conservatives and nationalists — a demographic that Putin has catered heavily to after widespread protests broke out in 2011 over disputed parliamentary elections. In recent years, they've raided art galleries and museums displaying art considered to be immoral, and have played an active role in dispersing gay rallies in Moscow and other cities. Some have raised questions, however, over the movement's ties to its historical roots, claiming that conservative activists are simply appropriating the Cossack uniform and tradition for political purposes.

"What you can't do, the Cossacks can."

"The question is to what extent those who wear Cossack uniforms in Sochi today have anything at all to do with historical Cossacks, or whether it's costumes only," says Maria Lipman of the Carnegie Moscow Center. "Those who dislike them will commonly refer to them as a costumed force or costumed Cossacks — like a carnival."

The Cossacks have received increased support and endorsements from some political leaders, as well. In 2012, the governor of Russia's Krasnodar region — host of this year's Olympics — enlisted 1,000 Cossacks to help stem the migration of dark-skinned Muslims from the North Caucus. The governor, Aleksandr Tkachev, is a close Putin ally and was a key figure in planning the Winter Games.

"What you can't do, the Cossacks can," Tkachev told regional police officers at the time. "We have no other way — we shall stamp it out, instill order; we shall demand paperwork and enforce migration policies."

Hundreds of Cossacks have been patrolling the grounds at the Olympics, which draw to a close on Sunday. They're allowed to apprehend people who violate public orders and check IDs, but are not allowed to make arrests. During a press conference in December, Putin described the Cossack forces as part of the Russian identity, noting that they can sometimes be more efficient than police because they're more representative of the people living in the region. Cossack dancers and singers performed during the Opening Ceremony in Sochi, though their involvement in the games has raised the ire of some ethnic groups that were killed or expelled from the region in the 19th century, under a military campaign that involved Cossack cavalry.

Following this week's attack on Pussy Riot, a police spokesman told the Wall Street Journal that Cossacks are usually accompanied by police officers when patrolling Sochi, and that "they spend the rest of their time as regular, ordinary citizens." On Twitter, Alyokhina claimed that police didn't intervene as the scuffle unfolded, though authorities insisted that they took "all necessary measures" to stop it.

Wednesday's incident came one day after Pussy Riot members Maria Aloykhina and Nadezhda Tolokonnikova were detained and questioned for hours by police investigating a theft at the hotel where they were staying. In 2012, Aloykhina and Tolokonnikova were arrested and sentenced to two years in prison for staging a protest against Russian President Vladimir Putin inside a Moscow cathedral. They were granted an early release from prison in December under an amnesty bill signed by Putin, but remain among the Kremlin's most outspoken critics. They arrived in Sochi this month to record their new music video and stage protests, despite tight government restrictions on public demonstrations during the games.

The incident left the group members bruised and at least one bloodied, but it didn't stop them from finishing what they set out to do. On Thursday, Pussy Riot released the video they were shooting this week in Sochi, replete with footage of their tussle with the Cossacks. Its title: "Putin will teach you to love the motherland."