A suicide bomber riding a motorbike blew himself up in an attack on an Indonesian police station on Tuesday, leaving one officer injured, an official said.
The attack in Solo city, the hometown of President Joko Widodo, came as the Indonesian leader was preparing to visit to celebrate the Islamic holiday of Eid with his family.
The authorities in the world's most populous Muslim-majority nation are on alert a day before Eid, amid fears Islamic State-linked militants could launch fresh attacks after January's deadly assault in Jakarta.
The attacker forced his way into the yard of the police headquarters in Solo city on Java island early in the morning as officers were preparing for an operation, said 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 told television station Metro TV.
The suspected militant died in the assault and a police officer was injured, he added.
Widodo called for people to remain alert after the attack, which happened on the last day of the Islamic holy month of Ramadan and a day before Eid.
"We urge people to stay calm... to continue focusing on fasting and to not be afraid in the face of such acts of terror," he said.
"I have ordered the police chief to hunt down and catch the network linked to this suicide bombing."
The Jakarta attacks claimed the lives of four civilians and four assailants, and were the first major Islamist terror assault in Indonesia for seven years.
Indonesia has suffered several Islamic extremist attacks in the past 15 years, including the 2002 Bali bombings that killed 202 people.
A crackdown had weakened the most dangerous networks, but the emergence of IS has proved a potent new rallying cry for radicals.
Hundreds of Indonesians have travelled to the Middle East to join the jihadists, stoking fears that extremist groups are being revived and more attacks could be on the horizon.
Last month, police arrested three suspected militants accused of planning to launch IS-inspired suicide bombings in Surabaya, the country's second-biggest city.