The killings began when the attacker shot dead two members of the security forces who were following him, say prosecutors.
He then raided a gun shop, killing an employee and a passer-by, before hijacking a car and shooting dead two police officers who were chasing him, said a spokesman for the prosecutor- general’s office.
As the police tried to disarm the man, he detonated explosives killing himself and one officer.
The prosecutor’s office described the 34-year old attacker as “a follower of jihadism,” saying he was named Kariyev.
A criminal investigation has been ordered into the killings.
“We never thought that this kind of thing could happen here,” a resident of Taraz told the Reuters news agency.
The assault is highly unusual for Kazakhstan, but follows a handful of bomb attacks in recent months.
Two bombs were detonated in the western city of Atyrau in October, but only the bomber was killed.
A previously unknown Islamist militant group, Jund al-Khilafah (Soldiers of the Caliphate), said it was responsible for that attack.
Two people were injured in May when a suicide bomber attacked a regional security building in the northern city of Aktobe.
Until this year, oil-rich Kazakhstan had not experienced any of the militant activity seen in some of its Central Asia neighbours.
However, following recent activity blamed on militants, the government introduced a new law to try to tighten its control over radical religious groups.