At least four Afghan policemen were killed when a suicide bomber drove a truck packed with explosives into a police base, officials say.
The incident took place in Wardak province, south-west of the capital, Kabul. Seventeen others were wounded, some of them critically officials say.
The blast went off as worshippers gathered at the police base mosque for morning prayers, AFP reports.
Members of the Afghan security forces are frequently targeted by militants.
The BBC's Jafar Haand in Kabul says the Narkh district, where the attack took place, is one of the most insecure areas of Wardak.
Many rural areas of the district are under Taliban control but Hizb-e-Islami insurgents are also active there.
Afghan forces are assuming more responsibility for security as Nato and US combat troops prepare to withdraw from the country by the end of 2014.