More than 40 people were wounded in the attack at the front of the mosque in Maymana, capital of Faryab province.
The provincial governor and police chief were said to be among those attending the prayers to mark the Eid al-Adha holidays, but they reportedly escaped without serious injury.
Civilians and police officers were among the dead, officials said.
Eye witnesses and officials said the suicide attacker approached the mosque and detonated his suicide vest after the Eid prayers had finished.
It is not clear now the attacker managed to get past at least four security checkpoints to target the mosque.
Deputy provincial governor Abdul Satar Barez told the AFP news agency that the attacker himself was wearing a police uniform.
Attacks in northern Afghanistan are far less common than in the south and east, and Faryab province has been considered to be relatively peaceful.
However at least 10 people were killed in an incident in April 2012 when a suicide bomber on a motorbike targeted a meeting of officials near the main vegetable market in Maymana.
At least 158 people have died in Spain's worst flooding disaster in generations. On October…
Google has been fined two undecillion (a two followed by 36 zeroes) roubles by a…
Embarking on a home remodel is an exciting journey, promising enhanced comfort, increased property value,…
The US presidential candidates continued to campaign across key swing states on October 20. Footage…
Elon Musk has said he will give away $1 million a day to a registered…
India and Canada have decided to expel their top envoys along with other diplomats as…