The attack was the second time this year that a suicide bomber has targeted police in Algeria
A suicide bomber killed two Algerian policemen on Thursday, including one who threw himself on the attacker whose explosive belt then detonated, state media said, citing the security services.
The officers had intervened when the attacker tried to enter the police headquarters in the region of Tiaret, about 350km southwest of the capital Algiers, the official APS news agency reported.
The agency said the "terrorist" had been carrying a weapon as well as wearing an explosive belt.
"The policemen on duty responded quickly, and one of them, in an act of bravery, threw himself on the assailant at the entrance of the headquarters and lost his life," the general directorate of national security said, quoted by the agency.
The Islamic State (IS) group claimed responsibility for the attack, the militant's media arm, Amaq, said. Police have not yet confirmed IS' claim.
The other police officer later died of his wounds, it added.
The attack was the second time this year that a suicide bomber has targeted police in the North African country.
In February a policeman foiled an attempted suicide attack on a police station in the eastern city of Constantine by opening fire on the approaching assailant and triggering the explosive belt he was wearing.
That attack was claimed by the Islamic State group.