Four sword-wielding assailants were shot dead with another nabbed, and one police officer was killed in the attack, National Police Spokesman Inspector General Setyo Wasisto said.
Five men attacked the Riau Police headquarters on Jl.
Previously Police chief of Riau province Inspector General Nandang said that a total of eight militants with a white minivan staged the attacks.
Police said the men belonged to a local extremist group, but not Jamaah Ansharut Daulah (JAD), which authorities believe was behind the family suicide bombings.
Local media said one attacker may have had a bomb strapped to his body but police have not confirmed the reports. Another man was arrested and four others were suspected to have fled the scene, it said.
Indonesia is the world's most populous Muslim-majority country.
In the ensuing chaos, at least two suspected terrorists, both wearing balaclavas, were spotted getting out of the auto wielding sharp weapons and attacking police officers.
Indonesia's security forces have arrested hundreds of militants during a sustained crackdown that smashed some networks, and most recent attacks have been low-level and targeted domestic security forces.
On Monday, a suicide bomb attack outside a police building, carried out by one family and claimed by the Islamic State of Iraq and the Levant (ISIL) group, killed at least 10 people.
According to reports from journalists at the scene, who were covering another story right before the attack, a white Toyota Avanza smashed into the outer fence of the police headquarters.
It was not clear if Wednesday's attack was linked to the earlier incidents.
The police shot two of them, Doddy said.