Islamic State militants have claimed a gun and bomb assault on Indonesia's capital, police say, marking the first assault on the Muslim-majority country by the radical group.
Five of the seven people killed were the attackers themselves.
It took security forces about three hours to end the siege near a Starbucks cafe and Sarinah's, Jakarta's oldest department store, after a team of around seven militants traded gunfire with police and blew themselves up.
"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.
Islamic State's statement said there were 15 people killed but the official tally according to the Indonesian Government remains at seven.
An Indonesian police officer and a Canadian man were two other people killed in the attack. Twenty people, including a Dutch man, were wounded.
Authorities said the policeman was killed in a suicide attack on a police booth on the median strip of one of Jakarta's busiest roads, before shots were fired at bystanders.
Deputy National Police Chief Budi Gunawan said two attackers were killed in a shootout with police, while two others were suicide bombers.
Two of the militants were taken alive, police said.
Jakarta's Police Chief Tito Karnavian confirmed the deadly blasts were linked to Islamic State.
"ISIS is behind this attack, definitely," he told reporters.
The Police Chief named an Indonesian militant called Bahrun Naim as the man responsible for plotting the attacks.
At least six explosions rocked the area, including one at a Starbucks cafe in the city centre, near a cluster of embassies and the United Nations offices.
Police earlier said the blasts were caused by grenades, not bombs.
There was also a gunfight between attackers and police in a movie theatre that was in the same building as a Starbucks cafe, a police spokesman said.
Jakarta police spokesman Muhammad Iqbal said that the situation was now under control.
The US Embassy in Jakarta said on Thursday it would remain closed on Friday as a precaution, but will remain open for emergency services.
Streets deserted, lined with debris in aftermath of attacks
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.
The ABC's South-East Asia correspondent Samantha Hawley said armoured trucks, the head of intelligence and bomb squad officers had also joined police at the scene of the blasts
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.
A candlelit protest has been held in Surabaya, Eastern Java island to condemn the attacks.
Indonesian President Joko Widodo said the blasts were "acts of terror".
"Our nation and our people should not be afraid, we will not be defeated by these acts of terror, I hope the public stay calm," he told MetroTV.
"We all are grieving for the fallen victims of this incident, but we also condemn the act that has disturbed the security and peace and spread terror among our people."
Editor-in-chief of the Jakarta Post, Meidyatama Suryodiningrat, said the targeted area was quite popular.
"It's less than one-and-a-half kilometres to the palace, it's basically where the centre of government is," he said.
"Five hundred metres away is the central bank building, you have multiple government buildings, major, major centre of government area."
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.
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 IS, whose battle lines in Syria and Iraq have included nationals from several Asian countries.
- ABC