MOSCOW — A gunman stormed a police station on Monday in Almaty, the largest city in Kazakhstan, and killed three officers and two civilians in an attack attributed to radical Islamist motivations.

The attack elevated concerns about the spread of terrorism in former Soviet Central Asia as an oil bust ripples through regional economies and the Islamic State’s footprint expands.

The police in Almaty said the attacker wrested a rifle from a guard at a police station, wounded him and then used the weapon to kill three police officers. As the battle raged, the gunman shot and killed one of the two civilian victims before hijacking his Toyota Corolla. He was later caught by the police and taken into custody.

Early on Monday, officers said that two men had attacked the police station. But later, in a clarification, they said that the second suspect was in fact a hostage — a taxi driver who had been forced to drive the gunman to the scene of the attack.