A pressure cooker bomb exploded in the courtyard of a government building in the Indonesian city of Bandung on Monday, police said, adding that the attacker had been shot and seriously wounded.

There were no reports of injuries from the explosion which occurred around 9.00 a.m. (0200 GMT) in the West Java city. Police said a man arrived at the government building on a motorbike and placed a pressure cooker on a table in a corner of the courtyard.

After the explosion, the man ran into the government office and was later shot by police.

"We have secured the firearm, the bomb squad has also secured a backpack. The bomb squad is combing the area to see if there are more homemade bombs," Anton Charliyan, West Java police chief, told Metro TV. "Situation is safe for now, but we must remain on alert and not underestimate things."

Police said they believed the motive for the attack was to force the release of prisoners held by the police anti-terror unit.

"The motive is to free suspects that are in Densus (Indonesia's anti-terrorism unit) custody. We think the attacker is from an old network, but we are still identifying who he is," Charliyan told reporters.

Suicide bombers and gunmen attacked the heart of Indonesia's capital Jakarta in January 2016 and the assault was claimed by Islamic State, the first time the radical group has targeted the world's most populous Muslim nation.

—Follow CNBC International on Twitter and Facebook.