The explosion occurred late Friday when the Mohammadiya mosque in the Khak-e-Ghariban area of Ghazni was packed with worshippers attending evening prayers, provincial governor spokesman Arif Noor said.
As many as 70 people were present at the time of the explosion, Nasir Ahmad Faqiri, the head of the Ghazni provincial council, and Councilor Amanullah Kamran said.
The Islamic State (IS) terrorist group claimed responsibility for the attack.
Earlier, the Taliban denied involvement in the mosque attack and condemned the bombing.
IS, which has a limited presence in Ghazni, is also suspected by locals of destroying a shrine known as Shams Sahib in the western part of Ghazni in May.
In recent months, Ghazni police have arrested several people on suspicion of having links to IS.
This article contains material from dpa, tolonews.com.