Several police officers fought back against the fighters, killing one and critically injuring another, in Sunday's incident.
"We suspect the attackers have links with ISIL and Bahrun Naim, because we found a ISIL flag, books and CDs linked to [the group] in the house of one attacker," Setyo Wasisto, national police spokesperson, told AFP news agency.
He was referring to Bahrun Naim, an Indonesian who is fighting with ISIL (the Islamic State of Iraq and the Levant group) in Syria and who has been accused of directing a series of mostly botched plots in his homeland in recent years.
Hundreds of young men from Indonesia have flocked abroad to fight with ISIL, also known as ISIS, and the country has seen a surge in plots and attacks linked to the group over the past year.
Police are investigating whether the incident was linked to the recent capture of three fighters accused of plotting to attack police, Wasisto, the police spokesperson, said.
In May suicide bombers killed three police officers at a bus station in Jakarta in the deadliest attack in Indonesia since January 2016, when a suicide blast and gun assault claimed by ISIL left four assailants and four civilians dead in Jakarta.
Indonesia has long struggled with violence and has suffered a series of fatal attacks in the past 15 years, including the 2002 Bali bombing that killed 202 people.
A sustained crackdown weakened the country's most dangerous networks but the emergence of ISIL has proved a potent new rallying cry.
Source: News agencies