Indonesian police hold rifles while walking behind a car for protection in Jakarta

Militants launched a gun and bomb assault killing at least six people in the center of the Indonesian capital today, police said, in an attack that followed a threat by Islamic State fighters to put the country in their "spotlight".

Six bombs went off and atleast three died while a gunfight was going on. One blast was in a Starbucks cafe and security forces were later seen entering the building.

Police said they suspected a suicide bomber was responsible for at least one of the blasts and up to 14 militant gunmen were involved in the attack.

Indonesia has been on edge in recent weeks over the threat posed by Islamist militants and counter-terrorism police have launched a crackdown on people with suspected links to Islamic State.

"We have previously received a threat from Islamic State that Indonesia will be the spotlight," police spokesman Anton Charliyan told reporters. But he said police did not know who was resposible.

He said three policemen and three civilians had been killed.

One explosion went off in front of a shopping center called the Sarinah mall, on a main avenue. Media said a police post outside the mall was blown up.

Police snipers were deployed among hundreds of other security officers.

A U.N. building near the scene was in lock-down with no one allowed in or out, a witness said. Some other high-rise buildings in the area were evacuated.

Indonesia's central bank is located in the same area, and a spokesman for the bank said a policy meeting was going ahead and a decision on interest rates would be announced as planned later in the day.

An explosion was heard in the western suburb of Palmerah, according to a domestic media tweet, but police said they could not confirm a blast there.

Indonesia has the world's largest Muslim population, the vast majority of whom practise a moderate form of the religion.

The country saw a spate of militant attacks in the 2000s, the deadliest of which was a nightclub bombing on the holiday island of Bali that killed 202 people, most of them tourists.

Police have been largely successful in destroying domestic militant cells since then, but officials have more recently been worrying about a resurgence inspired by groups such as Islamic State and Indonesians who return after fighting with the group.

The last major militant attacks in Jakarta were in July 2009, with bombs at the JW Marriott and Ritz Carlton hotels.