Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

An audacious bomb and gun attack on Westerners in the heart of Indonesia's capital was funded by ISIS, police said Friday after arresting three men on suspicion of links to the plot, seizing a militant flag from the home of one suspect.

National police chief Gen. Badrodin Haiti told reporters that Thursday's four-hour attack was funded by ISIS through Bahrun Naim, an Indonesian who spent one year in jail for illegal possession of weapons in 2011 and is now in Syria fighting for the self-declared caliphate.

ISIS also circulated a claim of responsibility for the attack through supporters' websites, saying the attack was aimed at people from countries fighting ISIS in Iraq and Syria.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

The ISIS link poses a grave challenge to security force in Indonesia, which until now was thought to have relatively few sympathizers an no active cells capable of planning and carrying out such an attack.

Two civilians — a Canadian and an Indonesian — were killed in Thursday's assault, in which five men attacked a Starbucks cafe and a traffic police booth with hand-made bombs, guns and suicide belts. The attackers were killed, either by suicide vests or subsequently by police.

Workers clean debris outside a Starbucks cafe, near the site Thursday's attack in Jakarta. BEAWIHARTA / Reuters

The attack "was funded by ISIS in Syria through Bahrun Naim," Haiti told reporters after Friday prayers, without elaborating.

He also identified one of the five attackers as Sunakim, who was once sentenced to seven years in jail for his involvement in military-style terrorist training in Aceh, but was released early.

Earlier Friday, police arrested three men at dawn in their homes in Depok on the outskirts of Jakarta, and more raids were being conducted in Java, Kalimantan and Sulawesi provinces based on evidence found at the scene, national police spokesman Maj. Gen. Anton Charliyan said.

"Now we can be sure that it was the action of ISIS because ISIS' flag was found in the house of one of the suspects," he said. "Hopefully, the group's (other) members will be captured soon."

Jakarta residents were shaken by Thursday's events but refused to be cowed.

The area near the Starbucks cafe remained cordoned off with a highly visible police presence. Onlookers and journalists lingered, with some people leaving flowers and messages of support.

A large screen atop the building containing the Starbucks displayed messages that said "#prayforjakarta" and "Indonesia Unite."