It came as no big surprise when a crumbling oil town in western Kazakhstan stirred in protest last Sunday 10 years after security forces there killed more than a dozen workers who had gone on strike over pay and poor conditions.
But it remains a mystery how peaceful protests over a rise in fuel prices last weekend in Zhanaozen, a grimy, Soviet-era settlement near the Caspian Sea, suddenly spread more than 1,600km across the full length of Central Asia's largest country, turning the biggest and most prosperous Kazakh city into a war zone littered with dead bodies, burned buildings and incinerated cars.
The violence this week in Almaty, Kazakhstan's former capital and still its business and cultural hub, shocked just about everyone - not only its leader, who, fortified by Russian troops, on Friday ordered security forces to "fire without warning" to restore order, but also government critics who have long bridled at repression and rampant corruption in the oil-rich nation.
The crisis coincided with a power struggle within the government, fuelling talk that the people fighting in the streets were proxies for feuding factions of the political elite. There is also feverish speculation about Kremlin meddling and a host of other murky possible causes.
About the only thing that is clear is that the country's convulsions involve more than a straightforward clash between protesters expressing discontent and the heavy-handed security apparatus of an authoritarian regime.
With Kazakhstan now largely sealed off from the outside world - its main airports are closed or commandeered by Russian troops, while Internet services and phone lines are mostly down - information is scarce.
Echoing the refrain of repressive leaders around the world confronted with protests, President Kassym-Jomart Tokayev on Friday lashed out at liberals and human rights defenders, lamenting that authorities had been too lax.
Not many people are buying that, particularly as it is a message endorsed by Russia, which on Thursday sent in troops to help Mr Tokayev regain control and has a long record of construing all expressions of discontent at home and in other former Soviet territory as the work of disgruntled liberal troublemakers. But there is growing evidence that the mayhem in Almaty, the epicentre of this week's turmoil, was more than just people power run amok.
Mr Tokayev, in an address to the nation on Friday, alluded to that, claiming that the violence was the work of some 20,000 "bandits" who he said were organised from "a single command post". Calls for negotiations with such people, he added, were "nonsense" because "they need to be destroyed and this will be done".
Mr Danil Kislov, a Russian expert on Central Asia who runs Fergana, a news portal focused on the region, speculated that the chaos was the result of "a desperate struggle for power" between feuding political clans, namely people loyal to Mr Tokayev, 68, and those beholden to his 81-year-old predecessor, Mr Nursultan Nazarbayev.
At the height of the tumult on Wednesday, the president announced that he had taken over as head of the security council, a job held until then by Mr Nazarbayev, who stepped down as president in 2019 but retained wide powers and was given the honorary title of Elbasy, or leader of the nation. Mr Tokayev also fired Mr Nazarbayev's nephew Samat Abish as deputy head of the main security service and purged several others close to the former president.
The riots in Almaty, Mr Kislov said, appeared to be an attempt by members of Mr Nazarbeyev's political clan to reverse their eclipse.
"This was all artificially organised by people who really had power in their hands," he said, adding that Mr Nazarbayev's ousted nephew seems to have played a major role in organising the unrest.
Mr Galym Ageleulov, a human-rights activist in Almaty who took part in what began as a peaceful demonstration Wednesday, said police officers monitoring the protest suddenly vanished around lunchtime. And "then this crowd came", he said, an unruly mob of what seemed more like thugs than the kind of people - students, bookish dissidents and middle-class malcontents - who usually turn out for protests in Kazakhstan.
He said the mob was "clearly organised by crime group marauders" and surged down main streets toward Akimat, the City Hall, setting cars on fire and storming government offices.
Among those who urged the crowd on was Mr Arman Dzhumageldiev, known as "Arman the Wild," by reputation one of the country's most powerful gangsters, who witnesses said provoked much of the violence. He gave frantic speeches on Almaty's central square as government buildings blazed behind him, calling for people to press the government to make concessions and mocking as a "coward" Mr Mukhtar Ablyazov, an exiled tycoon who is a bitter personal enemy of Kazakhstan's long-time former president, Mr Nazarbayev.
On Friday, the interior ministry said that its special forces unit had arrested Mr Dzhumageldiev, together with five accomplices. Mr Dzhumageldiev was the leader of an organised criminal gang, the ministry said.
On Friday, the US State Department said it was allowing non-emergency personnel at its consulate general in Almaty to leave voluntarily, citing the potential for sudden eruptions of violence.
That a possible power struggle could have morphed so quickly into mayhem on the streets is a measure of how brittle Kazakhstan is beneath the shiny surface of wealthy, cosmopolitan cities like Almaty.
Discontent, even if exploited by political elites, is very real. The country is less repressive than most in a region dominated by brutal strongmen - the former dictator of neighbouring Uzbekistan, Mr Islam Karimov, was accused of boiling his critics in vats of oil and having hundreds of protesters massacred in the town of Andijan in 2005.
But whatever the relative tolerance of their leaders, many Kazakhs still resent a kleptocratic elite that has poured billions into showcase projects like the construction of a new capital, named Nursultan in honour of the former president, while neglecting the well-being of many ordinary people.
The roots of that discontent are in places like Zhanaozen, the western oil town where this week's protests began - and where security forces in December 2011 opened fire on a group of striking workers. Unlike protests in Almaty, those in Zhanaozen and other western towns along the Caspian Sea, the centre of the Kazakh oil industry, have been peaceful throughout the week.
The region's senior official, Mr Zhanarbek Baktybaev, said on Friday that there had been no violence, lamenting that "as you know, in some region of our country there have been riots and looting by terrorist elements". Vital services, he said, were all working normally.
Mr Mukhtar Umbetov, a lawyer for the independent trade union in Aktau, next to Zhanaozen, said by telephone that protests had continued with no violence in the west of the country and expressed the anger of ordinary workers over rising inflation and stagnant salaries.
"Kazakhstan is a rich country," Mr Umbetov said, "but these resources do not work in the interests of the people; they work in the interests of the elites. There is a huge stratification of society."