Sardar Wali Tabasim, a spokesman for the Paktia province police chief, said another nine officers and 13 civilians were wounded in Sunday’s attack in Gardez city.
Tabasim added that all seven of the attackers were killed at the compound, which also houses the regional command for Afghanistan’s eastern provinces.
Taliban spokesman Zabihullah Mujahid said in a statement that the group was responsible for the attack.
Al Jazeera’s Rob McBride, reporting from Kabul, said the attack hit a “big target”.
“This is a big police headquarters. It is a big target and the attack seems to have followed a fairly familiar pattern,” he said.
“It seems there was a car bomb at the main gate, which opened a breach into the complex. Four or five attackers managed to then get inside and conduct this attack.”
— TOLOnews (@TOLOnews) June 18, 2017
Since the beginning of their spring offensive in late April, Taliban fighters have carried out a number of deadly attacks on the positions of the Afghan army and police.
Foreign forces assisting the Afghans have also been targeted.
Seven US soldiers were wounded on Saturday in an insider attack at a military base by an Afghan soldier described as a “patriot” by the Taliban.
In May, at least 15 Afghan soldiers were killed when Taliban fighters raided a military base in Kandahar province.
INSIDE STORY: Can the Taliban be defeated?
Source: Al Jazeera and news agencies