JAKARTA - Islamic State suicide bombers and gunmen struck the capital of Muslim-majority Indonesia Thursday, executing a Westerner and blowing up a Starbucks in an assault police said bore the hallmarks of the Paris attacks.

The assault on a district packed with malls, embassies and United Nations offices also left an Indonesian man dead and 20 others injured, in what the country’s president called “acts of terror”.

The Islamic State group claimed responsibility, saying that the attack was carried out by “soldiers of the caliphate” who targeted a gathering of citizens from the “crusader coalition,” referring to the US-led alliance combating the jihadists.

Jakarta police said the attack - which also destroyed a police post - was carried out by a network with links to IS in Syria and indicated Indonesian extremist Bahrum Naim, thought to have joined the jihadists, may have been involved in plotting it.

The IS attack will send a chill through Indonesia and other parts of Southeast Asia with Muslim populations, where there are fears extremists bloodied on Middle Eastern battlefields could have brought their jihad home.

Police said the five-strong cell that struck Thursday included three suicide bombers who initially targeted a Starbucks near a major shopping mall.

After the first explosion, men armed with pistols took two foreigners hostage — an Algerian and a man Ottawa said they had been told by Indonesian authorities was a Canadian.

National police spokesman Anton Charliyan said the Algerian managed to escape with bullet wounds, but the second man was shot dead on the spot.

“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.

“From what we see today, this group is following the pattern of the Paris attacks,” he added, referring to a wave of killings on the streets of Paris in November that left 130 people dead.

Witnesses described a gunman emerging from Starbucks, who began firing at bystanders and reloading his weapon as security forces approached, taking cover behind 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. Dead already.

“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.”

Graphic photographs from the scene showed the bloodied bodies of what appeared to be two men in civilian clothes lying by the side of a road next to the wrecked police post.

Another body, also apparently male, was pictured lying on his back in the centre of the street while a fourth, almost naked, lay nearby.

Jakarta police chief Tito Karnavian said bombs containing screws and nails were hurled at police during the shootout, and they found six bombs planted in the area after the hours-long assault ended.

Starbucks said it was shuttering all branches in the Indonesian capital until further notice “out of an abundance of caution” after the attack.

The area is home to several embassies, including those of the United States, France and Spain. A number of United Nations agencies are also housed nearby.

The UN Environment Programme said a married Dutch employee had been seriously hurt in the attacks and remained in a critical condition.