Suspected Islamist militants killed at least three policemen and a civilian in Kazakhstan's financial capital Almaty on Monday, with authorities saying they have detained at least two alleged attackers.
The attackers targeted a district police station and an office of the KNB state security service. Another shootout occurred on a busy central street where police wounded and detained one of the attackers.
President Nursultan Nazarbayev convened an emergency meeting of his security council to discuss the attacks, his office said.
The attacks will stoke fears of a growing Islamist threat to the oil-producing nation of 18 million. Last month men the authorities described as Islamic State sympathizers attacked gun stores and a national guard facility, killing seven people.
One security source told Reuters the authorities believed Islamist militants were behind Monday's attacks.
Hundreds of nationals from Kazakhstan and other Central Asian nations are known to be fighting alongside Islamic State militants in Syria and Iraq and the authorities have long warned they could return and carry out attacks on home soil.
Kazakhstan is far more prosperous than its post-Soviet neighbors and has been ruled with a firm hand by Nazarbayev since 1989.
But the fall in global oil prices has hit its economy hard and there have been rare outbreaks of violence and public protests since April, initially caused by discontent over proposed land reforms but swiftly attracting others unhappy about wider issues.
Five witnesses said they heard gunshots in three parts of Almaty, the mainly Muslim nation's largest city, on Monday.
"We saw a man with a rifle," one shop worker said by phone. Footage uploaded to the internet showed a man pointing an assault rifle at a car he tried and failed to stop.
The Interior Ministry said one attacker shot a policeman guarding a police station and then took his automatic rifle. He then shot two more policemen who chased him. The same man then tried to hijack a car, killing its civilian driver. He shot and wounded two more police officers before being wounded himself and detained on a busy street.
The ministry did not name the gunman but said the 27-year-old was also suspected of murdering a woman last weekend and had an accomplice who remained at large.
Initially authorities said a gunman was still at large, but the Interior Ministry said a second suspect has reportedly been arrested. It said in a statement that the detained person "had been beside the criminal" who tried to get into a district police station.
Last month, the KNB, successor to the Soviet-era KGB, said it had detained several members of a group planning "terrorist acts using improvised explosive devices."
The Kremlin said on Monday it was concerned by instability along Russia's borders following the attack in Kazakhstan, along with the failed coup attempt in Turkey and a hostage taking drama in Armenia.
"Certainly, this turbulence along our borders is a cause of concern," Kremlin spokesman Dmitry Peskov told a conference call with reporters. "Taking into account the information which we get, appropriate (security) measures are being taken."
"We would like to see our neighbors as prosperous, stable and predictable nations."
Follow VICE News on Twitter: @vicenews