The Interior Ministry has called the incident at the al-Zahra mosque, located on the western outskirts of the city, a "terrorist attack".
Danish said there was gunfire outside the mosque as the suicide bomber tried to force his way inside, but he was stopped by a police officer, who died in the explosion.
Among the dead were at least three civilians and one police officer, while four civilians and four police were wounded.
No group has so far claimed responsibility for the assault, but minority Shiite areas have been frequently targeted by Islamic State militants in the past.
Islamic State, a Sunni offshoot, said through its news agency that it orchestrated the attack on the Shia target.
General John Nicholson, the top U.S. commander in Afghanistan, has pledged to defeat the local IS affiliate this year. 30 people were killed and dozens others wounded in November a year ago in a similar attack on worshippers.
In April the U.S. military dropped its largest non-nuclear bomb ever used on an IS stronghold in eastern Afghanistan, killing dozens of jihadists, but fighting has continued unabated in the area. The worst attack in Afghanistan's 16-year war took place on May 31 when a massive truck bomb exploded at a busy intersection in Kabul, killing more than 150 people.