At least three suicide bombers have blown themselves up in a Starbucks cafe in Indonesia's capital Jakarta, as two gunmen attacked a police post nearby and three other explosions rocked other parts of the city.

At least one policeman and four people were killed in addition to the bombers.

The first explosion appeared to have caused a gun battle between the attackers and anti-terror police squads and gunfire could be heard more than one and a half hours later.

Tri Seranto, a bank security guard, said he saw at least five attackers, including three suicide bombers who detonated their explosives in Starbucks.

He said he was in the street when he saw the three men entering Starbucks and saw them blowing themselves up one by one. He said the other two attackers, carrying handguns, entered a police post from where he heard gunfire. He later saw one policeman dead and three seriously wounded. The two gunmen fled, chased by police.

The Starbucks attack happened at 10.30am local time.

Gunshots were heard after a mid-morning explosion in front of the Sarinah shopping mall and the police station. The area also has many luxury hotels, and offices and consulates, including the French embassy.

The other set of explosions were in neighbourhoods where the embassies of Turkey and Pakistan are located.

Indonesia has been a victim of several bombing attacks in the past, claimed by Islamic militant groups.

Last month anti-terror police arrested nine men and, cited a seized document, said the group wanted to "perform a 'concert' to attract international news coverage of their existence here".

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, the site of Indonesia's deadliest terror attack, which killed 202 people in 2002.

National Police spokesman Major General Anton Charliyan said security was focused on anticipating attacks in vulnerable regions, including Jakarta.

On Tuesday, jailed radical Islamic cleric Abu Bakar Bashir appealed to an Indonesian 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 reduced the sentence to nine years.

Indonesia, the world's most populous Muslim nation, has suffered a spate of deadly attacks by Jemaah Islamiyah 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. 

Tweets from the account of Jeremy Douglas, regional representative of the United Nations office on drugs and crime for south-east Asia and the Pacific, described a bomb and "serious" exchanges of gunfire on the street outside his Jakarta office.

"Didn't experience this in 3.5 years in Pakistan," he wrote.

"A massive bomb went off in front of our new Indonesia office as @collie_brown & I exit car. Chaos & we're going into lock-down."

Three minutes later he posted: "Apparent suicidebomber literally 100m from the office and my hotel. Now gunfire."

About 30 minutes after his first post about the bombing, he said things were "quiet. Not comfortable quiet".

An explosion was later heard from a cafe next to the Starbucks site.

Indonesian president Joko "Jokowi" Widodo, who is on a working visit in West Java town of Cirebon, has ordered security forces to hunt down the perpetrators and their network.

"We express condolence to those who became victims, but we all also condemn the attack that caused restless among the community," he said.

Mr Jokowi said he was cutting short his visit and returning to Jakarta.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.