The so-called Islamic State (IS) has said it was behind a series of explosions and gun attacks in the Indonesian capital Jakarta.
At least two civilians and five attackers died in the assaults, described as an attempt to mimic the deadly Paris attacks.
Security forces battled militants for hours in a major business and shopping district.
It follows warnings late last year that Islamists were planning a major attack.
“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,” the IS-linked news agency Aamaq reported.
The assault began late morning local time, when blasts struck near a Starbucks cafe and police security post, in an area close to embassies and government buildings.
“There was lot of commotion, a lot of craziness,” said Rob Phillips, an English teacher who lives in the area.
“We heard a large bang. We thought it was thunder because the storms here are pretty big.”
Gunmen fled to the Djakarta Theater, part of the same complex that houses the Starbucks, where a standoff developed with police.
Explosions and gunfire rang out for hours before police declared the situation under control.
Bodies of the militants killed were left sprawling in the street. Police said 20 people were injured in the attacks, including five police officers.
The attack on the Indonesian capital is sadly part of a pattern that has been repeating itself in several cities around the world in recent months.
Istanbul, Paris and now Jakarta have all experienced what counter-terrorism officials classify as a “Marauding Terrorist Firearms Attack”, or MTFA for short.
In other words, police forces have had to react quickly to the sudden appearance of an unknown number of gunmen rampaging through the heart of an urban area, intent on killing as many people as possible and securing themselves maximum publicity.
The aim for the authorities in each case is to bring the situation under control as fast as possible with minimal loss of life, something that UK and other forces have been rehearsing since the disastrous Mumbai siege of 2008.
But preventing such attacks requires better intelligence and needs more effective sharing of information among the people who need to know it.
National police spokesman Anton Charliyan said the perpetrators had “imitated” the Paris attacks.
He said police had received warnings in November from IS they were planning a “concert in Indonesia”, meaning an attack.
Two of the attackers were killed in a suicide bombing, police said, with the other three killed in gun battles with police.
A Canadian and an Indonesian national, both civilians, also died.
Indonesian President Joko Widodo has called on his country not to be defeated by “these acts of terror”.
Several foreign governments advise caution while visiting Indonesia, with the UK Foreign Office urging its nationals to “maintain vigilance” after the attacks.
Indonesia was on high alert over the new year period after threats from IS.
Up to 200 Indonesians are estimated to have gone to Syria to fight with IS.
Indonesia is the world’s most populous Muslim nation but is largely secular, although in recent years the threat of radicalism has remained high as small networks of militants are still thought to be operating in the country.
Source- Myjoyonline