Six suspected Islamic militants killed in a standoff with police were planning to attack police officers in Indonesia's East Java province to seek revenge for the arrest of a radical leader, authorities said Sunday.

The men were cornered in a village in Tuban district on Saturday after attempting to shoot a traffic police officer who was approaching them when he saw their car stopped at the roadside, said national police spokesman Rikwanto.

The six refused appeals to surrender during a standoff that lasted several hours and were fatally shot by police, said Rikwanto, who goes by a single name.

On Friday, counterterrorism police arrested three suspected militants who were allegedly planning to attack a police station in East Java. Among those arrested was Zainal Anshori, a senior figure of Jemaah Anshorut Daulah, an umbrella group of Indonesian extremists that claims allegiance to the Islamic State group.

Rikwanto said that Anshori had orchestrated Saturday's planned attack.

"They had acted on Anshori's order as a revenge of his arrest," said Rikwanto, citing police interrogation of other arrested militants.

Police said they seized dozens of rounds of ammunition, several firearms, knives, jihadi books and a car used by the men.

Muslim-majority Indonesia has carried out a sustained crackdown on militants since the 2002 Bali bombings by al-Qaida-affiliated radicals that killed 202 people, mostly foreigners. A new threat has emerged in the past several years from Islamic State group sympathizers.