* Russia says withdrawal to be completed on Jan.19
* Deployment added to strains in Russian-U.S. ties
* Ex-security chief investigated for possible coup (Adds Putin, Russian defence minister comments)
ALMATY, Jan 13 (Reuters) - A Russia-led military bloc began pulling out from Kazakhstan on Thursday after a week-long deployment amid an explosion of unrest during which authorities in the Central Asian nation said the former security chief was suspected of attempting a coup.
Russia said the withdrawal of the troops would be completed by Jan. 19, earlier than previously announced. Their deployment had been criticised by Western leaders alarmed by a buildup of Russian troops near Ukraine. Moscow has denied allegations it plans to invade but said security talks this week had hit a dead end https://www.reuters.com/world/europe/russia-says-us-nato-talks-so-far-unsuccessful-2022-01-13 and threatened unspecified consequences.
President Vladimir Putin said the mission in Kazakhstan had been a success and was a practice that warranted further study.
Kazakh President Kassym-Jomart Tokayev asked for assistance from the Collective Security Treaty Organisation (CSTO) last week after initially peaceful protests, triggered by a sharp increase in car fuel prices, turned violent in many big cities.
"Thanks to your arrival, Kazakh military and security forces were able to carry out their immediate task of locating and detaining bandits," Kazakh Deputy Defence Minister Mukhamedzhan Talasov told CSTO troops at a departure ceremony in Almaty on Thursday, where they stood with their respective flags. The Russian group was the most numerous.
The Kazakh authorities announced the completion of what they called an "anti-terrorist operation" in most of the country on Wednesday, although they have yet to declare its biggest city Almaty fully secure.
It was unclear how many troops out of about 2,500 sent in by the CSTO were leaving immediately.
CSTO troops were first deployed to government buildings in the capital city of Nur-Sultan, away from the centres of unrest, and later guarded some key infrastructure objects in Almaty, such as large power plants.
The authorities have detained almost 10,000 people over the unrest in which some protesters attacked security forces, captured and torched government buildings and looted shops.
They have said some of the attackers were foreigners trained by Islamist militants. Tokayev has said this justified CSTO involvement although he has not specified who the foreigners were. He has dismissed some of his senior security officials who were later charged with treason.
Authorities in Kazakhstan said on Thursday they were also investigating the former head of state security, Karim Masimov, on suspicion of an attempted coup.
At the height of the unrest, Tokayev said he was taking over former president Nursultan Nazarbayev's position as chairman of the security council - through which the longtime former leader was still wielding sweeping powers. Nazarbayev has not been seen in public since the protests broke out.
Some Kazakhs have echoed a comment by U.S. Secretary of State Antony Blinken that Kazakhstan might have a hard time getting rid of Russian troops after letting them in. Tokayev has said no foreign troops would remain in the country after Jan.23.
Russian Defence Minister Sergei Shoigu said on Thursday the pullout would be completed on Jan. 19, the Interfax news agency reported.
Putin praised the CSTO peacekeepers' work.
"Everything worked like clockwork: fast, coherent and effective," Putin told Shoigu on state television. "I want to thank you, the general staff and everyone who led this operation, for this work and to express my hope that this practice of using our armed forces will be studied further."
"All in all, we should return home. We have accomplished our task," he added.
(Reporting by Olzhas Auyezov and Mariya Gordeyeva; Additional reporting by Alex Marrow in Moscow; editing by Philippa Fletcher)
Our Standards: The Thomson Reuters Trust Principles.