The Islamic State group on Thursday claimed responsibility for deadly shootings and suicide bombings that rocked the Indonesian capital.

In a statement published online, the jihadist group said that a number of bombs "detonated at the same time as attacks from four soldiers of the caliphate… with light weapons and suicide belts."

Suicide attackers on Thursday struck at the heart of the capital of Muslim- majority Indonesia, executing a Westerner and killing a local while blowing up a Starbucks cafe, leaving five attackers dead in the ensuing firing.

Five extremists launched an assault copying "the pattern of the Paris attacks" as they detonated explosives and shot at people in a district packed with malls, embassies and United Nations offices.

The assault also left an Indonesian man dead and 19 other people injured, and a police post destroyed, in what the country’s president dubbed "acts of terror".

"There is a strong suspicion that this is an ISIS-linked group in Indonesia," national police spokesman Anton Charliyan told AFP, referring to the Islamic State group by an alternative name.

"From what we see today, this group is following the pattern of the Paris attacks."

IS gunmen killed 130 people in a series of coordinated attacks on the French capital in November.

Police chief Charliyan said the five-strong cell who struck today included three suicide bombers who initially targeted a Starbucks opposite a major shopping mall.

After the first explosion, two men armed with pistols took two men hostage. He identified them as an Algerian and a Dutch national, however Jakarta police chief Tito Karnavian said the second man was Canadian.

Charliyan said the Algerian managed to escape with bullet wounds, but the second man was shot dead on the spot and that an Indonesian man who had tried to help the hostages was also shot and killed.

"Soon afterwards, two men riding…. motorbikes, ran into a police post and blew themselves up," he said, adding four officers had been left in a critical condition.

Witnesses said the gunman who emerged from Starbucks began firing at bystanders, reloading his weapon as security forces moved in behind the cover of moving vehicles.

"I heard a loud bang, boom. It felt like an earthquake. We all went downstairs," said Ruli Koestaman, 32, who had been in a nearby building when the attack started mid-morning.

"We then saw that the Starbucks downstairs was destroyed too. I saw a foreigner — westerner, a man — with a mangled hand but alive.

"A Starbucks waiter then ran out with blood coming out of his ear. And I asked anyone hurt inside, he said yes, one.

"Then everybody gathered and a terrorist appeared. He had a gun and started shooting at us and then at Starbucks. Then the police post… exploded."

Police said there were four blasts, although eyewitnesses reported at least six.