Nobody immediately claimed responsibility for the attack in the capital of Faryab province, but it happened in an area where the Taliban and allied militant groups are active.
The Taliban have threatened a campaign of violence to disrupt the April 5 vote, which will choose a new president to lead the country as foreign troops prepare to end their combat mission by the end of the year.
Provincial Governor Mohammadullah Patash gave the death toll and said 23 people also were wounded in the attack.
The Taliban have staged numerous attacks in Faryab, far from their traditional strongholds in southern and eastern Afghanistan.
More From This Section
In October 2012, a suicide bomber struck a mosque packed with senior regional officials in Maymana, killing 41 people.
Afghan civilians are frequently caught up in the violence as insurgents battle Afghan and international troops in an effort to undermine the Western-backed government.
The Taliban deny that they target civilians, but the UN report blamed 74 per cent of all civilian casualties last year on insurgents.