The attack by Islamic State militants targeted the Eidgah Mosque in Kabul where a memorial service was being held for the mother of Taliban spokesman Zabihullah Mujahid. Initial information showed two were killed, but local media quoted the interior ministry as saying eight people had been killed and 20 wounded.
Since the Taliban takeover of Afghanistan in mid-August, attacks by IS militants have been on the rise.
The Islamist group is violently opposed to the Taliban and the attacks have raised the possibility of a wider conflict between the two groups.