The ministry’s spokesman Mohammad Nafi Takor told the AP news agency that 20 people were injured in the powerful explosion.
Hundreds of people were gathered in the mosque when the explosion took place after Friday prayers, according to local residents.
It is therefore feared that the death toll could rise, and eyewitnesses and local media report far more victims.
The Taliban-led Interior Ministry has not provided further details on the incident. Taliban soldiers have cordoned off the area around the Sunni mosque and hospital, and journalists are not allowed in.
The cause of the explosion at the end of the Muslim fasting month of Ramadan is not yet known, and no one has yet claimed responsibility.
The extremist Islamist group IS has carried out a series of bombings against Shiite targets in Afghanistan in recent months.
Local media report that the nearby Istiqlal Hospital is overcrowded and can no longer receive the wounded. The Italian-run hospital Emergency states that it has received at least 20 wounded after the explosion.
According to unconfirmed reports, the roof of the mosque collapsed in Friday’s explosion.