The force's elite anti-terror unit killed the two men during a firefight on Sunday in a village in Poso district on Sulawesi island, said national police spokesman Agus Rianto.
"When we tried to arrest them, they resisted. There was a firefight and two from the group were killed," he said, adding that two policemen were injured.
Seven suspected militants have been arrested over several days, including five in the South Sulawesi capital of Makassar, Rianto said.
The world's most populous Muslim-majority nation has struggled with Islamic extremism for more than a decade, facing a series of attacks on Western targets, although a crackdown has weakened the most dangerous networks.
The militants on Sulawesi are thought to be among the few that remain a real threat in Indonesia. They regularly launch attacks but these tend to target Indonesian security forces and be low-impact.
But fears are growing about the influence of the Islamic State group, with some worried that Indonesians returning from fighting in Iraq or Syria could revive sophisticated militant networks.