A heavily fortified compound housing foreigners in the Afghan capital of Kabul has been struck by an explosion followed by gunfire, local officials said.

A car bomb detonated at the gates of the Green Village in eastern Kabul, which has been the target of attacks against foreigners in the past.

Police said gunfire could be heard after the blast although it was not immediately clear whether the shots came from inside or outside of the compound housing international workers employed by service companies.

Security forces have surrounded the area, Kabul's police chief, Gen. Mohammad Zahir, said.

"Initial reports we have gathered show that the Green Village is the target. Small explosions from either grenades or RPGs (rocket propelled grenades) can be heard," a senior security official told Reuters, speaking on condition of anonymity.

It was not immediately known if anyone was wounded in the attack -- the second on foreign workers in a few days.

Earlier this week, two security guards were killed after a suicide bomber rammed a small truck packed with explosives into a western compound operated by security services company Hart in the capital. Taliban militants claimed responsibility for the attack.