ARTICLE AD BOX
Kazakhstan's former intelligence chief has been arrested on suspicion of treason following nationwide anti-government protests.
The detention of Karim Massimov was announced by the National Security Committee, a body he headed until his removal this week.
Authorities now appear to be back in control of the largest city Almaty.
But President Kassym-Jomart Tokayev said "terrorist" attacks were still happening in some places.
He made the comments in a phone call with Russian counterpart Vladimir Putin, who sent hundreds of troops to Kazakhstan this week to help restore order.
President Tokayev has blamed foreign-trained "terrorists" for the unrest, without giving evidence.
The protests began in response to fuel hikes but grew to reflect discontent at the government and former President Nursultan Nazarbayev, who led the country for three decades and is still thought to retain significant influence.
The Interior Ministry says 26 "armed criminals" and 18 security officers were killed in the clashes. More than 4,000 people have been detained, according to the ministry.
The figures have not been independently verified. Phone lines and internet services were down during the protests making establishing a full picture of events difficult.
Kazakh authorities gave no other details about why Mr Massimov was arrested.
On top of his role as head of the intelligence agency, which grew out of the Soviet state security force the KGB, Mr Massimov was a close ally of President Nazarbayev, twice serving as his prime minister.
His arrest has sparked rumours of a power struggle in the Kazakh government, the BBC's Carrie Davies in Moscow reports.
Also this week President Tokayev removed Mr Nazarbayev from his role as head of the influential Security Council, appointing himself in his place.
Kazakhstan: The basics
Where is it? Kazakhstan shares borders with Russia to the north and China to the east. It is a huge country the size of Western Europe.
Why does it matter? A former Soviet republic which is mainly Muslim with a large Russian minority, it has vast mineral resources, with 3% of global oil reserves and important coal and gas sectors.
Why is it making the news? Fuel riots, which have escalated to become broader protests against the government, have resulted in resignations at the top and a bloody crackdown on protesters.