At least one police officer has been injured in a suicide attack on an Indonesian police station. The bike-borne assailant blew himself up at the police station on Monday morning, officials said.

The attack took place in Solo city, the hometown of President Joko Widodo. The president was scheduled to visit the town to celebrate the Eid festival.

The attacker came to the yard of the police headquarters in Solo city on Java island early in the morning as officers were preparing for an operation, AFP reported citing national police spokesman Boy Rafli Amar.

"He argued that he wanted to go to the canteen. He forced his way in using a motorbike and blew himself up," the spokesman said. The suicide bomber died and at least one officer was injured.

President Widodo exhorted people to remain alert. "We urge people to stay calm... to continue focusing on fasting and to not be afraid in the face of such acts of terror ... I have ordered the police chief to hunt down and catch the network linked to this suicide bombing," the president said.

A terror attack on Jakarta earlier this year that killed four civilians had raised concerns over Islamic State-affiliated militancy in the region.