BAKU, Azerbaijan — Authorities in Azerbaijan say a suspect in this week's fatal stabbing of two senior police officials has been killed as police tried to detain him.

The police officers were stabbed to death while confronting about 200 demonstrators in the western city of Ganja on Tuesday. Police dispersed the protest and detained 40 participants.

A first suspect was arrested Wednesday. Authorities allege he belonged to a radical Islamic group and was plotting a coup.

Police said they located the second suspect in a nearby city Friday morning. He resisted arrest and was shot and killed.

The protest in Ganja over the arrest of a man accused of attacking the local mayor erupted while President Ilham Aliyev was traveling abroad. In a statement on Friday, he called the events a terrorist attack.