A policeman shot dead eight fellow officers at a western Kenyan police station on Thursday after learning of his demotion, security forces said.
The man, initially believed to be a terrorist, was later killed by a special forces team after he took several police officers hostage at a station near the Ugandan border.
"The attacker, who was first assumed to be a detained terrorist, turned out to be a local policeman," authorities said.
The policeman grabbed a gun from a guard and began shooting other officers after he learned that he was to be demoted, police chief inspector Joseph Boinnet said.
"His attempt to escape was thwarted" by the arrival of a quick response team at the Kapenguria police station, Boinnet said.