A suicide attack in Afghanistan's northern province of Kunduz killed at least eight people including a district governor and two of his bodyguards at a mosque on Friday, government officials say.

The group, which included the governor of the Archi district, was attending a funeral of a tribal elder who had died the day before, the officials said.

"Officials... were attending a prayer in a mosque when a suicide bomber detonated his explosives," said Enayatullah Khaliq, a spokesman for the provincial governor.

The district governor, Sheikh Sadruddin, had been in his position since 2002 and been active in the fight against the Taliban.

At least 11 civilians were also injured in the morning blast, police said.

It was the latest in a string of attacks this week across Afghanistan, where fighters are seeking to destabilise the government before the withdrawal of most international troops by the end of 2014.

Government officials and aid groups working with government ministries and Afghan security forces have been targeted in reprisal killings this week in provinces previously regarded as relatively stable.

Six men who worked for a development programme were executed in western Herat, one of Afghanistan's more stable provinces with a prosperous private sector that is helping to drive the national economy.

The toll on security forces this week has also been high. An ambush in western Farah killed 15 policemen and another four were killed in Ghazni in the east in a Taliban attack on an international military base.

Several soldiers were also killed in Helmand, a Taliban stronghold in the south.