Seven people have been killed after militants set off bombs in Jakarta and opened fire on police, leaving bodies in the streets, as office workers watched on in horror from high-rise windows.
Police said the attackers, five of which are dead, "imitated the attack in Paris" on November 13 that killed 130 people, and were likely to be linked to the Islamic State.
General Anton Charliyan said police had received information in late November about a warning from IS that "there will be a concert" in Indonesia, meaning an attack.
The other two dead are thought to be civilians, although early reports suggested a police officer had been killed.
The Netherlands' foreign minister said that a Dutch man has been seriously wounded in the attack and was undergoing surgery.
Foreign Minister Bert Koenders says the attack shows that "terrorism can hit everybody. Whether you are shopping in the heart of Paris, in a New York office or on vacation in Jakarta."
Reports suggested the attack included three suicide bombers who targeted multiple locations including a Starbucks cafe and a busy shopping centre near the presidential palace.
Footage of two suicide bombers blowing themselves up near the cafe has surfaced. A gun battle with attackers was also said to have taken placed inside a cinema at a retail complex.
Bombs were detonated near the Sarinah shopping mall, and United Nations offices in central Jakarta, along with three others in the Cikni, Silpi and Kuningan neighbourhoods, near the Turkish and Pakistani embassies.
President Joko "Jokowi" Widodo said on local television: "This act is clearly aimed at disturbing public order and spreading terror among people."
Jokowi who is on a working visit in West Java town of Cirebon, said he is returning to Jakarta immediately.
"The state, the nation and the people should not be afraid of, and lose to, such terror acts," he said.
The president's attitude in the aftermath of the attack was shared by the people of Indonesia, as the hashtag #KamiTidakTakut - which translates as "We Are Not Afraid" - was widely shared across social media.
Widodo ordered security forces to hunt down the perpetrators and their network behind the attacks.
"We express condolences for those who became victims, but we all also condemn the attack that caused restlessness among the community," he said.
The Islamic State have carried out several attacks in the past across Indonesia, the world's most populous Muslim nation. Thursday's attack is the first major terror incident in Jakarta since the bombings of two hotels in 2009 that killed seven people and injured more than 50.
A bomb in a nightclub on the resort island of Bali in 2002 killed 202 people, mostly foreigners.
General Anton Charilyan, a national police spokesman, said the attacks involved an unknown number of assailants with grenades and guns. He said they "imitated" the recent terror acts in Paris, on November 13 in which 120 people were killed, and were likely from IS, but gave no evidence.
No one immediately claimed responsibility for Thursday's attack on Thamrin Street, however, Aamaq, a news agency affiliated with IS, quoted an unidentified source as saying the militant group carried out the attack.
"A source to Aamaq: Fighters from the Islamic State carried out this morning an armed attack that targeted foreigners and the security forces tasked with protecting them in the Indonesian capital Jakarta," it said.
The first of Thursday's explosions apparently triggered a gun-battle between the attackers and anti-terror police squads, and gunfire could be heard more than 1 ½ hours later.
Tri Seranto, a bank security guard, told The Associated Press he saw at least five attackers, including three suicide bombers who he claimed entered Starbucks and blew themselves up one by one.
Starbucks has since issued a statement saying it believed an explosion took place close to one of its stores in the Skyline building near one of the police posts in downtown Jakarta. It said one customer sustained injuries and was treated on the scene while all employees had been confirmed safe.
Seranto said the other two attackers, carrying handguns, entered a police post from where he heard gunfire. He said he later saw one policeman dead and three seriously wounded.
He said he was not injured in the explosions as he was a little distance away, but close enough to witness the attack at 10.30 am. (2.30am GMT).
He said the two gunmen ran away with police chasing them.
About two hours later, another explosion was heard from a cafe near the Starbucks, about five minutes after 25 anti-terror policemen entered it. It was not clear if the explosion was a controlled detonation or a bomb.
Gunshots were heard after the midmorning explosion in front of the Sarinah shopping mall and a police station. The area also has many luxury hotels, and offices and embassies, including the French. The other set of explosions were in neighbourhoods where the embassies of Turkey and Pakistan are located.
Tweets from the account of Jeremy Douglas, regional representative of the United Nations Office on Drugs and Crime for Southeast Asia and the Pacific, described a bomb and "serious" exchanges of gunfire on the street outside his Jakarta office.
The latest from office window. No view of scene. Seeing tactical teams going in, pic.twitter.com/abkxHNganC— Jeremy Douglas (@jdouglasSEA) January 14, 2016
Quiet over a hour. Latest from the window is media drifting closer to operations. Told lockdown to last pic.twitter.com/s6FaPpeT5V— Jeremy Douglas (@jdouglasSEA) January 14, 2016
Last month, anti-terror police arrested nine men and said the group had wanted to "perform a 'concert' to attract international news coverage of their existence here." Police cited a document seized from the group that described the planned attacks as a "concert."
The country has been on high alert after authorities said they had foiled a plot by Islamic militants to attack government officials, foreigners and others. About 150,000 police officers and soldiers were deployed during New Year's Eve to guard churches, airports and other public places.
More than 9,000 police were also deployed in Bali.
National Police spokesman Major General Anton Charliyan said security is focused on anticipating attacks in vulnerable regions, including Jakarta.
On Tuesday, the jailed radical Islamic cleric Abu Bakar Bashir appealed to an Indonesia court to have his conviction for funding a terror training camp overturned, arguing that his support for the camp was an act of worship.
The 77-year-old leader of the Jemaah Islamiyah militant network filed a judicial review of his 2011 conviction, when he was sentenced to 15 years in jail for setting up the camp in Aceh province. A higher court later cut the sentence to nine years.
Indonesia has suffered a spate of deadly attacks by the Jemaah Islamiyah network in the past. But strikes in recent years have been smaller and less deadly, and have targeted government authorities, mainly police and anti-terrorism forces.