The scene had echoes of the Paris attacks: a bustling shopping area shaken by the blasts of suicide bombers and gunfire as onlookers fled in terror.
But when Thursday's assault in central Jakarta was over, the death toll was far lower. Of the seven killed, five were the attackers themselves and only two were civilians – a Canadian and an Indonesian. Another 20 people were wounded.
Still, authorities and analysts believe the violence that left the city of 10 million on edge for hours was a loud announcement of the Islamic State group's presence in the world's largest Muslim-majority nation.
Supporters of the Islamic State circulated a claim of responsibility on social media resembling the militants' previous messages.
The attackers carried handguns, grenades and homemade bombs and struck a Starbucks café and a traffic-police booth in the Indonesian capital's highest-profile attack in six years.
Police arrested three men on suspicion of links to Jakarta attack, Indonesian television reported on Friday morning.
Authorities said they found a large, undetonated bomb and five smaller devices in a building near the café.
"So we think … their plan was to attack people and follow it up with a larger explosion when more people gathered," said Major-General Anton Charliyan, the spokesman of Indonesia's national police. "But thank God it didn't happen."
Jakarta police chief Major-General Tito Karnavian said the attackers had links with the Islamic State and were part of a group led by Bahrum Naim, an Indonesian militant who is now in Syria. "We have identified all attackers," Maj.-Gen. Charliyan said. "We can say that the attackers were affiliated with the ISIS group," he added, using an acronym for the Islamic State group.
The claim was shared on Twitter late Thursday, and the U.S.-based SITE Intelligence Group said it also was circulated among pro-Islamic State groups on other media.
Jakarta is no stranger to terrorism, with the 2009 bombings of two hotels that killed seven people and injured more than 50. The bloodiest attack by Islamic extremists in Indonesia – and in all of Asia – was in 2002, when a nightclub bombing on the resort island of Bali killed 202 people, mostly foreigners.
Those and others were blamed on the al-Qaeda-inspired Jemaah Islamiyah. Following a crackdown by security forces, militant strikes in recent years have been smaller and less deadly, and have targeted government authorities, mainly police and anti-terrorism forces. Terrorism experts say Islamic State supporters in Indonesia are drawn from the remnants of Jemaah Islamiyah.
Maj.-Gen. Charliyan said police had received information in late November about a warning from the Islamic State that "there will be a concert" in Indonesia, meaning an attack. Last month, anti-terror police arrested nine suspected militants and said they had planned attacks "to attract international news coverage of their existence here."
Indonesian authorities deployed 150,000 security personnel, made arrests and said they foiled a plot to kill government officials, law-enforcement officers and others. The heightened security ended Jan. 6.
Southeast Asian terrorism expert Sidney Jones wrote in November that Bahrum Naim has been urging his Indonesian audience to study the Paris attacks. "While the police and army have been focused on going after Indonesia's most wanted terrorist, Santoso, in the hills of Central Sulawesi, ISIS has succeeded in building a network of supporters in the suburbs of Jakarta," Mr. Jones wrote.
Taufik Andri, a terrorist analyst, said although the attack ended swiftly and badly for the attackers, their aim was to show their presence and ability.
"Their main aim was just to give impression that ISIS's supporters here are able to do what was done in Paris. It was just a Paris-inspired attack without being well-prepared," he said. Those attacks in November killed 130 people.
Thursday's first suicide bomb went off at about 10:50 a.m. at the Starbucks, which is near some UN offices, a shopping centre and other western restaurants, including McDonald's, Pizza Hut and Burger King. The neighbourhood is home to many luxury hotels, high-rise buildings and diplomatic offices, including the French embassy.
Maj.-Gen. Karnavian told reporters that after customers ran out of the café, two gunmen outside opened fire, killing the Canadian and wounding an Indonesian.
Prime Minister Justin Trudeau said Ottawa was working with Indonesian authorities.
"The hearts of Canada and Canadians go out to the people of Indonesia and all the families and victims of these terrible attacks," Mr. Trudeau said at an appearance in Kitchener, Ont.
The federal government updated its travel advisory for Jakarta in the aftermath of the attacks, advising Canadians to remain vigilant, follow the advice of local authorities and avoid the city's downtown area.
With a report from The Canadian Press