No one was reported wounded in the assault in the major city on Java island which police said was linked to a "terrorist network". The attacker was captured after a standoff lasting about an hour.
After the blast, which reports said came from a bomb constructed out of a pressure cooker, the attacker fled into a building belonging to local authorities.
Television footage showed armed police exchanging fire with the man inside, and part of the building was set on fire.
"We tried to negotiate but instead the perpetrator tried to burn (the place)," he told local TV station MetroTV.
More From This Section
"He's from a terrorist network," he added, without elaborating.
Charliyan said the attacker, whom he did not identify, was injured during the standoff.
Indonesia, the world's most populous Muslim-majority country, has long struggled with Islamic militancy and was hit by series of attacks in the past 15 years, including the 2002 Bali bombings that killed 202 people, mostly foreign tourists.
A sustained crackdown weakened the most dangerous networks but the emergence of the Islamic State (IS) group has proved a potent new rallying cry for the country's radicals and hundreds flocked to the Middle East to fight with the jihadists.