A security source said a car bomb was detonated by a terrorist near the gate of a guesthouse belonging to Spanish Embassy Friday evening in Shairpoor locality.
The blast was followed by several warning shots of gunfire.
The bomber and one bystander were killed and seven others, including security guards and some passersby, were wounded by the blast.
Authorities have launched an investigation into the incident.
The Taliban militant group claimed responsibility for the attack.
The Taliban have urged civilians to stay away from official gatherings, military convoys and centers regarded as the “legitimate” targets.
Shairpoor and the neighboring Wazir Akbar Khan gave house to several diplomatic compounds and high-ranking officials’ residents.