A suspected militant has attacked police with a machete and pipe bombs on the outskirts of the Indonesian capital before being shot and killed.
Jakarta police said three officers including a local chief were injured.
The attacker was shot several times and died on the way to hospital due to blood loss from wounds to his legs and stomach, a spokesman said.
Footage broadcast on TVOne showed the man limping around a busy city road carrying weapons including what appeared to be a pipe bomb. At one point, the footage showed him running towards an officer.
Police said the injured officers have stab wounds and are being treated in hospital, but were unaffected by explosives thrown by the attacker.
Officers were monitoring a protest when the attack occurred in the satellite city of Tangerang.
The attacker, named as Sultan Azianzah, 21, was unemployed and a member of Daulah Islam, a hardline group in Ciamis in West Java province, said a police spokesman.
Radical Islamic groups in Indonesia, the world's most populous Muslim nation, have been weakened by a sustained security crackdown since the 2002 bombings on the tourist island of Bali.
But IS's high-profile attacks in the Middle East and Europe and the group's online propaganda have helped to recruit a tiny minority of Indonesians to their cause, mostly teenagers and young adults.
Experts say their capacity to mount successful attacks is still limited.
An attack in central Jakarta in January killed eight people including four militants. Subsequent attacks have failed completely, including a would-be bombing of a church in Medan, Sumatra, and an attack on a police complex in Solo, Java, that killed only the suicide bomber.
Police seized sharp weapons, pipe bombs and an IS sticker as evidence in the Tangerang attack. They believe Azianzah travelled to greater Jakarta with the intention of attacking police, a frequent target of Islamic militants in Indonesia.
Local media reported that the attack unfolded after police intervened when the man tried to put an IS symbol on a police post.