"The bomber killed himself in front of the compound. Two people were killed and two more were wounded, all Afghan guards," said Interior Ministry spokesman Najib Danesh.
Dozens of police swarmed to the area, where shattered glass from cars lay on the ground, and cordoned it off.
It was not immediately clear which foreign forces run the compound, although Afghan security officials said it is US-run. A spokeswoman at the US embassy in Kabul said its security team was investigating the blast.
The Taliban took responsibility for the attack, which happened at 8:20am (0350 GMT) local time, Taliban spokesman Zabihullah Mujahid told Reuters by telephone from an undisclosed location.
Embassy sirens sounded and ambulances could be heard after the blast, which happened in the area where the US and British embassies and the headquarters of the Nato-led International Security Assistance Force (ISAF) are located.
A spokesman for ISAF said the coalition was aware of an explosion and that one of its vehicles had been damaged.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ