The explosion occurred as mourners gathered at Hisarak village in the province of Khost for the funeral of Hakim Taniwal, the governor of neighbouring Paktia province who was assassinated on Sunday.
Mohammad Ayoob, a Khost police chief, said: "It was a suicide attack carried out by a young boy around 16 to 17. We found his severed head after the blast."
Taniwal died in a suicide bomb attack outside the governor's office in Gardez, the capital of Paktia province.
The Taliban, involved in heavy fighting in southern and eastern Afghanistan, claimed responsibility for the latest attack and threatened more to come. They also said it carried out the attack on Taniwal.
Mohammad Wali Noori, a doctor at Khost's main hospital, said: "Five policemen were killed and 30 other people, most of them policemen, were injured."
A spokesman for Hamid Karzai, the president, who was a friend of the dead governor, also said it was a suicide attack.
Officials said none of the senior Afghan officials attending the funeral was killed.
Taniwal, in his 60s, had spent about 20 years in exile in Melbourne, Australia. He returned after the Taliban government was overthrown by US-led forces.
He also served as a minister in Karzai's government and as governor of Khost province, which neighbours Paktia.