A gunman who killed three policemen and a member of the public in Kazakhstan on Monday may have been an Islamist militant, the president has said.
Nursultan Nazarbayev called the shootings in the commercial capital Almaty a terrorist act.
The terrorism threat level has been raised.
Suspect Ruslan Kulikbayev, 26, became close to Salafists - ultra-conservative Muslims - when serving a prison sentence, security officials said.
He was the only person detained after the attack. The interior ministry initially said an accomplice was still at large but officials have since said they believe the shootings were the work of just one person.
A Reuters news agency report suggests the death toll may be as high as six.
Monday's attack comes a month after a deadly assault by suspected Islamist militants in the north-western town of Aktobe.
Oil-rich Kazakhstan has also recently seen rare protests by people angry at proposed land reforms.
A gunman attacked a police station in central Almaty, killing the three police officers in an exchange of fire, police said.
While fleeing the scene, he shot and killed a local resident before hijacking his car.
Kazakh authorities said two police officers had also been wounded in the attack and identified the detained gunman as a former convict wanted for the murder of a woman earlier this month.
Reuters quoted an anonymous hospital source as saying a suspect was among the dead on Monday.
President Nazarbayev has ordered tighter security measures in public areas, the agency adds.
In the attack in Aktobe last month, groups of men targeted gun stores and a military base, killing seven people. At least 18 attackers were killed by police.
Kazakhstan is wealthier than other post-Soviet central Asian states, and has been ruled by its authoritarian president since 1989.
Correction August 2 2016: This story has been amended to remove an incorrect reference that protests against land reform had been accompanied by violence.