Indonesian militants supporting the Islamic State militant group planned to attack a police post on New Year's Eve with machetes and knives, a police spokesman said Monday.

The plot was broken up after police arrested two of the would-be attackers who led them to their hideout, where police shot dead their two co-conspirators Sunday after police said they tried to attack officers with machetes.

"The four of them were planning to attack a police post in Purwakarta. They planned to attack on New Year's Eve," Rikwanto, a national police spokesman, told reporters, referring to a district about 100 km (60 miles) east of the capital, Jakarta.