The bombing was carried out on Friday inside the crowded Eid Gah mosque in Maymana city, the capital of Faryab province.
“As a result of the explosion, 32 people are dead, 17 civilians and 15 police and intelligence agents. The provincial police chief, Abdul Khaliq Aqsai is among the wounded,” said deputy provincial governor Abdul Satar Barez.
No group has claimed responsibility for the bomb attack, but local officials put the blame on the Taliban militants.
Insecurity continues to rise across Afghanistan despite the presence of foreign forces in the war-torn country.
Overall, more than 3,000 civilians died in violence related to the Afghan war and over 4,500 people were wounded in 2011.
The United States and its allies invaded Afghanistan in 2001 under the pretext of combating terrorism.