This week's militant attack in the heart of Indonesia's capital at first appeared to bear the hallmarks of recent spectacular strikes by Islamic State: a meticulously planned, multi-stage assault designed to sow confusion and take many lives.
But things may not have gone completely to plan.
In interviews with witnesses and authorities, as well as video obtained by Reuters, a picture emerges of a calculated attack that swiftly fizzled out due to the militants' lack of sophisticated weaponry and amateurish execution.
Police say the five militants who attacked a Starbucks cafe and police post in central Jakarta came lightly armed, with just two pistols and about a dozen low-yield homemade bombs. Over half an hour in which all the militants died, they succeeded in killing two people, and wounding 31.
The assault was "planned and organized but did not have the maximum impact," national police spokesman Anton Charliyan told reporters on Friday.
He said the attack was "a new style of terrorism in Indonesia" modeled on the radical group's attack in Paris in November, in which coordinated attacks by gunmen armed with automatic rifles killed 129 people.
"But these were guns and small bombs carried by individuals on motorbikes, (so) they couldn't fit many," he added.
According to witnesses and video, the shooters appeared to frequently miss their targets, and most bombs did little damage.
The largest explosion came at the denouement of the attack, when the militants appeared to blow themselves up by accident.
Security experts said the attackers appeared to be locals who were not trained or battle-hardened on Islamic State's front lines in Syria or Iraq.
Kevin O'Rourke, a respected commentator on Indonesia, said Islamic State leaders may conclude the attackers demonstrated "relatively weak prowess" with their weapons, and this could "blunt the impetus for attempting other such operations with Indonesian suicide attackers".
Despite all this, witnesses described an attack that initially followed a clear script, and was carried out with chilling brutality.
At about 10:30 a.m. on Thursday, one militant emerged from a toilet in a Starbucks cafe and detonated a suicide bomb, killing himself and injuring several others, police said.
"The sound was incredibly loud and I could feel the tremors. I saw two women running out of the building, they were hysterical, screaming 'help' and 'there's a bomb'," Urip Hidayat, a security guard at a nearby bank, told Reuters.
Within minutes, two other suicide bombers entered a nearby police post and blew themselves up. As a crowd of bystanders and police gathered to take in the scene, two gunmen approached from behind and mingled with them.
One, dressed in a black shirt and wearing trainers and a red backpack, pulled out a pistol and began shooting, photographs published in the local media showed.
Muhammad Bahrun Naim (L) attends his trial at the Solo's District Court, February 21, 2011 in this photo taken by Antara Foto.
"Everyone scattered," Naldo Januario Tuwaidan, a security guard who watched from across the road, told Reuters. "When the crowd cleared there was just a body lying in the road."
"Ready to die"
With three suicide bombers dead, the two remaining militants headed the 50 meters to the Starbucks as the streets cleared out. Unchallenged by police, they stalked their victims in the area near the cafe, said Ronny Gunawan, 38, who watched from a nearby office tower. The men sauntered in and out of a nearby building with chilling calm, he said. "They were ready to die."
By a fence, Gunawan saw what appeared to be a foreign man lying wounded. "An Indonesian tried to help him, but while he was trying to drag the guy away, one of the terrorists ... came up and shot both of them point-blank in the head," he said.
A roughly 25-minute video obtained by Reuters shows what happened next. As police closed in, the militants huddled by their two victims, exchanging gunshots and hurling homemade bombs that exploded in puffs of white smoke but causing little apparent damage.
Twice, the militant wearing the red backpack approached the prone victims and shot them again.
A police bullet then appeared to hit a second militant who reached towards his colleague and took an object. Seconds later, both men were consumed by an explosion. In the tower across the road, Gunawan and his friends cheered.
"The terrorist seemed to reach for another bomb, but blew himself up by accident," Gunawan said.
An Indonesian policeman inspects a bullet hole on a car window in front of a Starbucks cafe, the site of a militant attack, in Jakarta, Indonesia January 15, 2016.
Police then advanced cautiously, firing dozens of shots into the two dying militants. About half a dozen bombs were later recovered on the dead men - signs of preparation for a longer battle.
No resources or skills
Indonesian authorities have identified Bahrun Naim, an Indonesian believed to be with the Islamic State in Syria, as the likely mastermind of the attacks.
Police said Naim hopes to stage spectacular attacks in order to stake a claim to the leadership of the group in Indonesia, where militant groups have floundered in recent years in the face of police crackdowns and ideological splits.
The most recent major attack in Indonesia was a bombing of two luxury hotels in Jakarta in 2009 that killed seven people, including three foreigners.
Todd Elliot, an expert on militancy at Concord Consulting, said Thursday's assault showed local militants are still struggling to emulate that attack, or another Paris.
"The weapons they used were crude home-made weapons," he said. "It seems they don't have the resources or skills to buy or create more powerful explosives."