Attackers set off a series of explosions in a bustling shopping area of Indonesia's capital city Thursday morning in what authorities said was an imitation of last November's terror attacks in Paris that killed 130 people. Backers of the Islamic State terror group claimed responsibility.

All five attackers and a Canadian and Indonesian died in the midmorning explosions and gunfire not far from the presidential palace and the U.S. Embassy, police said. Another 19 people were injured.

When the area was finally secured a few hours later, bodies were sprawled on sidewalks. But given the firepower the attackers carried — handguns, grenades and homemade bombs — and the soft targets they picked in a bustling, crowded area, the casualties were relatively few compared to the mayhem and carnage caused by the Paris attacks.

Data curated by FindTheData

"We have identified all attackers ... we can say that the attackers were affiliated with the ISIS group," national police spokesman Maj. Gen. Anton Charilyan told reporters.

Dutch Foreign Minister Bert Koenders said the attack showed that "terrorism can hit everybody. Whether you are shopping in the heart of Paris, in a New York office or on vacation in Jakarta."

Police had repeatedly warned in recent weeks that Islamic militants were planning something big in Jakarta, a city of 10 million people. It was the first major terror attack in Indonesia since the 2009 bombings of two hotels that killed seven people and injured more than 50. Before that, a bombing in a nightclub on the resort island of Bali in 2002 killed 202 people, mostly foreigners.

"This act is clearly aimed at disturbing public order and spreading terror among people," President Joko "Jokowi" Widodo, said in statement on television. Jokowi, who is on a working visit in the West Java town of Cirebon, said he is returning to Jakarta immediately.

"The state, the nation and the people should not be afraid of, and lose to, such terror acts," he said.

An American now working in Jakarta as a security consultant for a major oil company told FoxNews.com an attack was bound to happen," given how many residents have traveled to Islamic State.

"Eight-hundred Indonesians have gone to fight in Syria and Iraq," he said. "Included in those numbers are families and children of fighters. Some of them are dead, some are bound to come back."

Jakarta police chief Maj. Gen. Tito Karnavian told a news conference that the first suicide bombing happened at a Starbucks restaurant, causing customers to run out. Outside, two gunmen opened fire, killing a Canadian and wounding an Indonesian, he said.

At about the same time two other suicide bombers attacked a nearby traffic police booth, killing themselves and an Indonesian man. Karnavian said that minutes later a group of policemen was attacked by the remaining two gunmen, using homemade bombs. This led to a 15-minute gunfight in which both attackers were killed, he said.

Police then combed the building housing the Starbucks and another nearby building where they discovered six homemade bombs — five small ones and a big one.

"So we think... their plan was to attack people and follow it up with a larger explosion when more people gathered. But thank God it didn't happen," Charilyan said.

The U.S. Embassy in Jakarta released an emergency message warning American citizens to avoid the area around Sari Pan Pacific Hotel and Sarinah Plaza due to the ongoing attack.

Starbucks said one customer sustained injuries from one of the explosions and was treated at the scene, while all employees were confirmed to be safe. The company also said its stores in Jakarta would be closed until further notice as a precaution.

"We are deeply saddened by the senseless acts that have taken place in Jakarta today," the company said in a statement. "Our hearts are with the people of Indonesia."

The nation has been on high alert after authorities said they had foiled a plot last month by Islamic militants to attack government officials, foreigners and others. About 150,000 police officers and soldiers were deployed during New Year's Eve to guard churches, airports and other public places. More than 9,000 police were also deployed in Bali.

The Associated Press contributed to this report.