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.
An Indonesian and a Canadian were killed in the attack. Twenty people, including an Algerian, Austrian, German and Dutchman, were wounded.
A member of the police bomb squad unit approaches the scene of an explosion following an attack on a police box in central Jakarta on January 14, 2016. (Reuters photo)
Jakarta's police chief told reporters: "ISIS is behind this attack definitely," using a common acronym for the group, 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.
In a sign of public unease, a bang caused by a tyre bursting triggered a bomb scare that sent police cars rushing back to the scene hours after the attack.
"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.
Jakarta police chief Tito Karnavian said one man entered the Starbucks cafe and blew himself up, wounding several inside.
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 policemen with weapons and an armoured vehicle guard in front of a Starbucks cafe at Thamrin business district in Jakarta on January 14, 2016. (Reuters photo)
Australian Attorney-General George Brandis, who was in Jakarta recently to bolster security coordination, told the Australian newspaper he had "no doubt" ISIS 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 ISIS, 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 ISIS and Indonesians who return after fighting with the group.
Alarm around the world over the danger stemming from ISIS 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 ISIS.
Speaking in London, US Secretary of State John Kerry condemned Thursday's attack.
"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," he said.
Harits Abu Ulya, an 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."
What Pak's Ex ISI Chief, Facing Court Martial, Is Accused Of Pak Ex ISI Chief Faiz Hameed Taken Into Army Custody Ahead Of Court Martial "Was Playing With Ideas": Lawyer Of Suspect In Taylor Swift Concert Attack Plot Rahul Gandhi's Seat At Red Fort Triggers Fresh Congress Attack On BJP "Don't Expect Anything From Me": Kolkata Hospital's New Principal Loses Cool Nurse Raped, Killed On Way Home, Body Found 9 Days Later In UP "Took Advantage Of His Addiction": 5 Charged Over Matthew Perry's Death Unable To Repay Loans, 3 Of Family Die By Suicide In Karnataka: Cops Theft At Official Residence Of Jaivardhan Singh, Cash Stolen: Cops Track Latest News Live on NDTV.com and get news updates from India and around the world.