Islamic State officially claimed responsibility on Thursday for a gun and bomb assault in the centre of Jakarta earlier in the day that killed seven people, five of whom were attackers.
"A group of soldiers of the caliphate in Indonesia targeted a gathering from the crusader alliance that fights the Islamic State in Jakarta through planting several explosive devices that went off as four of the soldiers attacked with light weapons and explosive belts," the group said in a statement.
Just seven people were killed despite multiple blasts and a gunfight, and five of them were the attackers themselves, but the brazenness of their siege suggested a new brand of militancy in a country where low-level strikes on police are common.
It took security forces about three hours to end the attack near a Starbucks cafe and Sarinah's, Jakarta's oldest department store, after a team of seven militants traded gunfire with police and blew themselves up.
An Indonesian and a Canadian were killed in the attack. Twenty people, including an Algerian, Austrian, German and Dutchman, were wounded.
Hours after police declared the attack over, there were fresh explosions in or around the same location, Kompas TV reported on its Twitter account. Police officials said they could not yet comment on the cause of the blasts.
"Islamic State fighters carried out an armed attack this morning targeting foreign nationals and the security forces charged with protecting them in the Indonesian capital," Aamaaq news agency, which is allied to the group, said on its Telegram channel.
Jakarta's police chief told reporters: "ISIS is behind this attack definitely," using a common acronym for Islamic State, and he named an Indonesian militant called Bahrun Naim as the man responsible for plotting it.
Police believe Naim is in the Syrian city of Raqqa.
The drama played out on the streets and on television screens, with at least six explosions and a gunfight in a movie theatre. But the low death toll pointed to the involvement of local militants whose weapons were rudimentary, experts said.
Armored cars, helicopters
"The Starbucks cafe windows are blown out. I see three dead people on the road. There has been a lull in the shooting but someone is on the roof of the building and police are aiming their guns at him," Reuters photographer Darren Whiteside said as the attack unfolded.
Police responded in force within minutes. Black armoured cars screeched to a halt in front of the Starbucks and sniper teams were deployed around the neighbourhood as helicopters buzzed overhead.
Jakarta police chief Tito Karnavian said one man entered the Starbucks cafe and blew himself up, wounding several inside.
As people poured out of the cafe, two waiting gunmen opened fire on them. At the same time, two militants attacked a police traffic post nearby, using what he described as hand grenade-like bombs.
After the militants had been overcome, a body still lay on the street, a shoe nearby among the debris. The city centre's notoriously jammed roads were largely deserted.
Indonesian police bomb squad members work at the site of a bomb blast site at Thamrin business district in Jakarta, January 14, 2016. Photo: Reuters//Beawiharta
Indonesia has seen attacks by Islamist militants before, but a coordinated assault by a team of suicide bombers and gunmen is unprecedented and has echoes of the sieges seen in Mumbai seven years ago and in Paris last November.
Australian Attorney-General George Brandis, who was in Jakarta recently to bolster security coordination, told the Australian newspaper he had "no doubt" Islamic State was seeking to establish a "distant caliphate" in Indonesia.
The last major militant attacks in Jakarta were in July 2009, with bombs at the JW Marriott and Ritz Carlton hotels.
The country had been on edge for weeks over the threat posed by Islamist militants.
Counter-terrorism police had rounded up about 20 people with suspected links to Islamic State, whose battle lines in Syria and Iraq have included nationals from several Asian countries.
History of attacks
Indonesia has the world's largest Muslim population, the vast majority of whom practise a moderate form of Islam.
The country saw a spate of militant attacks in the 2000s, the deadliest of which was a nightclub bombing on the holiday island of Bali that killed 202 people, most of them tourists.
Police have been largely successful in destroying domestic militant cells since then, but officials have more recently been worrying about a resurgence inspired by groups such as Islamic State and Indonesians who return after fighting with the group.
Alarm around the world over the danger stemming from Islamic State increased after the Paris attacks and the killing of 14 people in California in December.
On Tuesday, a Syrian suicide bomber killed 10 German tourists in Istanbul. Authorities there suspect the bomber had links to Islamic State.
Harits Abu Ulya, a expert on militancy who knows Bahrun Naim, the militant named by Indonesian authorities, said he expected more attacks.
"This is an indication that he has been learning from the Paris attacks and he has studied the strategy," he said. "I still have doubts about the capability of the local militants to carry out attacks on a bigger scale. But it is a possibility."