Afterward, a top official said the time had come for the state to allow Cossack patrolmen to carry traumatic guns, nonlethal weapons that can inflict severe injuries at close range — a proposal that has been endorsed by the governors of Krasnodar and Stavropol.

“Some human rights activists, some ill-wishers, talk a lot about whether it’s necessary or not necessary,” Nikolai A. Doluda, chieftain of the Kuban Cossack Army and a deputy to the governor, told Russian television. “This terrible, frightening event underlines the fact that it is necessary.”

Historians still argue about who the Cossacks were — descendants of escaped serfs or Tatar warriors, an ethnic group in their own right or a caste of horsemen. They played a crucial role in colonizing the south for the Russian empire, and later turned on peasant and worker uprisings, defending the czar.

The Bolsheviks nearly obliterated them, deporting tens of thousands in a process they called “de-Cossackization,” but the image of the Cossack, wild and free, was a permanent part of the Russian imagination.

When Tolstoy sat down to write his classic novel “The Cossacks,” he set it near present-day Stavropol, where the Terek River divided the Muslim-populated mountains from the steppes, which were Cossack country. In a scene taught to generations of schoolchildren, a young Cossack spots a Chechen swimming across the Terek disguised as a log and shoots him.

The notion of an ethnic dividing line is widely accepted to this day, but it is running up against demography. Muslim ethnic groups in the Caucasus have a high birthrate, and Russians are abandoning the steppe. About 81 percent of Stavropol’s population is ethnic Russian, but that share has been shrinking for decades, the International Crisis Group has reported.

Image Credit... The New York Times

This rapid change is unsettling to ethnic Russians in Stavropol, who sometimes refer to the newcomers as “shepherds.” Gennady A. Ganopenko, 42, said he grew up in a city so homogeneous that “the sound of a non-Russian language was grounds for a brawl.”