A police squad led by the counter-terrorism unit Detachment 88 Tuesday evening surrounded a house in South Tangerang city, on the outskirts of the capital Jakarta, where there was a gathering of suspected militants, National Police spokesman Ronny Sompie said.
"We told them to surrender but they resisted. They shot at police and we had to open fire. The operation ended only early this morning," Sompie told AFP, saying the shootout lasted hours.
"They are suspected of being involved in several terror activities in 2013, including the shooting of police officers," he said.
Police seized explosive materials and firearms from the house, Sompie said, confirming that six men had been killed and one was arrested.
Police said the men were connected to Abu Roban, a suspected militant who was killed in an anti-terror raid in May 2013 and previously led a religious-study group in Tangerang.
The men targeted in the raid are suspected of orchestrating an attack on a Buddhist temple last August, where a low-intensity bomb went off and lightly injured one person, Sompie said.
About 6,500 police have been deployed for security on New Year's Eve and New Year's Day in Jakarta and surrounding areas.
Indonesia has been rocked by several deadly terror attacks over the past decade, including the 2002 bombings on the resort island of Bali that killed 202 people, mostly foreigners.
Since then the country has waged a long crackdown on terrorism, dismantling some of the deadliest networks, and only low-impact attacks have been executed.
Police officers have become the main target for some active terror groups.