Updated

Four Taliban militants who attacked a compound housing foreign workers in the Afghan capital were killed Wednesday night in a failed assault there, police said, the latest violence targeting foreigners in the country.

One attacker died when he detonated a vehicle packed with explosives near the gate of the Green Village compound in eastern Kabul, police chief Gen. Mohammad Zahir said. Police officers killed the other three attackers in a shootout, Zahir said.

"There were no civilian or military casualties," Zahir said.

The Taliban claimed responsibility for the attack on Twitter accounts that previously carried messages from the group.

The explosion that started the attack, which struck about at 9 p.m., could be heard throughout Kabul.

The heavily fortified Green Village has come under attack previously. The last assault targeting the compound took place on Oct. 13, 2013, when a suicide car bomber killed two passers-by. Another attack there in 2012 killed seven guards and civilians.

This is the second attack on a foreign compound in the Afghan capital in recent days. On Monday, the Taliban claimed responsibility for a suicide attack on a compound operated by Hart, a security services company. That attack killed two Afghan security guards and three attackers.

Insurgent activity has intensified in the months since President Ashraf Ghani was inaugurated as president and ahead of the withdrawal of foreign forces at the end of the year.