JAKARTA, Indonesia — Terrorists laid siege to the heart of Indonesia's capital on Thursday with a four-hour gun and bomb assault that left seven people dead and 24 others wounded, officials said.
Five attackers waged armed battles with police around a busy shopping and movie theater complex in downtown Jakarta, setting off several explosions — including one at a Starbucks.
There was no direct claim of responsibility, but the ISIS-linked Amaq News Agency said the Islamist terror group was behind the attack. Jakarta's police chief identified a regional ISIS figure as the ringleader.
As the brazen daytime attack unfolded, the U.S. Embassy warned citizens to "shelter in place" until all the gunmen had been captured or killed. It later said no Americans were injured but warned "further incidents are possible," adding that the embassy would remain closed Friday.
Five hours after the attacks unfolded, Indonesian authorities said all five attackers were killed and security forces were in control.
Two civilians — including a Canadian national — died in the siege, according to Indonesia's foreign ministry.
It said twenty-four people also were wounded, including five police officers and four foreigners: an Algerian, an Austrian, a German and a Dutch national who was undergoing emergency surgery at the hospital.
The siege began at around 10:45 a.m. local time Thursday (10:45 p.m. Wednesday ET) at a busy intersection near a police station and a Starbucks, according to Jakarta police spokesman Col. Muhammad Iqbal.
"I was riding a motorbike when suddenly the explosion went off at the police post," eyewitness Eliaz Warre told The Associated Press. "I saw people running away and two people lying on the ground bleeding. I also saw two people on a motorbike with a back pack and they are the guys who threw the bomb."
A gun battle broke out between the attackers and anti-terror police squads, and gunfire could be heard more than 1½ hours later. Witnesses described seeing bodies in the streets as heavily-armed security forces were deployed.
United Nations official Jeremy Douglas was working from the organization's building near the scene when shots erupted.
"You could hear a gun fight in the street," he told NBC News. "There were a lot of panicked people running towards our building and staff in my office were pretty freaked."
A customer at the Starbucks was wounded, the company said, adding that all its stores in the city were being closed as a precaution.
"The Starbucks cafe windows are blown out. I see three dead people on the road," Reuters quoted one of its photographers as saying.
Armored vehicles could be seen patrolling the city's streets in the hours after the attacks.
Indonesia's president Joko Widodo cut short a trip to Java to return to the capital as the events unfolded; world leaders quickly condemned the attack and expressed support for the nation.
"These acts of terror are not going to intimidate nation-states from protecting their citizens," U.S. Secretary of State John Kerry told reporters in London. "There is nothing in any act of terror that offers anything but death and destruction. And so we stand together, all of us, united in our efforts to eliminate those who choose terror."
While there was no formal claim of responsibility from ISIS itself, Jakarta's police chief Tito Karnavian told reporters that an ISIS-linked cell operating in Southeast Asian nations was the "gang" behind the attack.
"There's a militant named Bahrun Naim who wants to be the leader of the region," As he said. "All leaders [of ISIS] in Southeast Asia are competing to be the chief. That's why Bahrun Naim plotted this attack."
He said on television that "our country, nation and the people must not be or and defeated by the terror attack like this."
Indonesia, the world's most populous Muslim nation, was named in a list of potential global targets by ISIS in the September issue of its official magazine, Dabiq, and the country has been the victim of several attacks in the past claimed by Islamic militant groups.
Last month, anti-terror police in the country arrested nine men and said ISIS had wanted to "perform a 'concert' to attract international news coverage of their existence here," according to Reuters. Police cited a document seized from the group that described the planned attacks as a "concert."
Thursday's attack was the most serious in Jakarta since the July 2009 bombing of the JW Marriott and the Ritz-Carlton hotels, according to Anton Alifandi, principal terror analyst at IHS Country Risk.
"In the past several years, militants have carried out a number of small-arm attacks targeting the police but today's is notable for the targeting of an international commercial brand, indicating increased risk of attacks against such targets," he said. "The location of the attacks is significant as it indicates the continuing terrorist capability to perpetrate attacks in the heart of the capital."
Ed Flanagan reported from Beijing, Alastair Jamieson reported from London.
This story originally appeared on NBCNews.com