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.
President Joe Biden has urged pro-Palestinian protesters on university campuses to uphold the rule of…
Blue Ivy Carter has joined the voice cast of The Lion King prequel Mufasa: The…
At least five people, including a four-month-old baby, have been killed after dozens of tornadoes…
Harvey Weinstein has been hospitalized just days after his 2020 rape conviction in New York…
Hamas has published a video showing the first proof of life of US and Israeli…
Prosecutors and Donald Trump’s attorneys delivered opening statements and the first witness was called on…