Three militants launched a strike on the police headquarters in Riau province of Indonesia on Wednesday and one attacker was shot dead, national police spokesman Muhammad Iqbal said.
"Four masked men rushed out of the vehicle and attacked the officers using swords", national police spokesman Setyo Wasisto told reporters in Jakarta. Police shot and killed the four suspected terrorists, he added.
"When the auto broke through into the Riau police headquarters, it was blocked by policemen", Wasisto told a televised news conference.
"Then four of the men got out from the auto and attacked police", he added.
The men crashed their auto into a number of police officers, who were on guard at the entrance of the Police headquarters, reported Indonesian news agency Antara.
"It was really quick. Suddenly people wearing masks got out and stabbed police officers at the scene", said Doddy Vladimir, Tribun Pekanbaru reporter.
Attack comes after multiple bombings in Surabaya in the past week.
In a message carried on its Amaq news agency, Islamic State has claimed responsibility for the attacks in Surabaya.
The attack follows a prison riot in Jakarta, suicide bombings in three churches in Surabaya city, the provincial capital of East Java.
Indonesia - which is set to host the Asian Games in just three months and an IMF-World Bank meeting in Bali in October - has long struggled with Islamist militancy, including the 2002 Bali bombings that killed over 200 people in the country's worst-ever terror attack.
That blast appeared to have been an accidental detonation that killed a mother and her 17-year-old child who was not identified, police said.
The families have been linked to the local chapter of Indonesian extremist network Jamaah Ansharut Daulah (JAD), which police said was behind the attacks.