Suspected Islamist militants have killed at least four policemen and one civilian in Kazakhstan's financial capital Almaty, security and hospital sources say, the second attack on the security services in less than two months.
The attackers targeted a district police station and an office of the KNB state security service on Monday.
Another shootout occurred on a busy central street where police wounded and detained one of the attackers.
President Nursultan Nazarbayev called the attacks a terrorist act and ordered tighter security in public areas.
The shootings will stoke fears of a growing Islamist threat to the oil-producing nation of 18 million people. Last month, men the authorities said were Islamic State sympathisers attacked gun stores and a military facility, killing seven.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
Nazarbayev said the security services were working to identify Monday's attackers, but one security source told Reuters the authorities believed they were Islamist militants.
Thousands of nationals from 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 neighbours 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 told Reuters they heard gunshots in three parts of Almaty, the mainly Muslim nation's largest city.
"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.

