Kabul's police chief has resigned, following a surge in attacks by Afghan militants on foreigners in the city over the past two weeks.
General Zahir Zahir gave no reason for his resignation, his spokesman said.
Three South Africans were killed in a Taliban attack on a compound used by a US-based charity on Saturday, the third such attack in the past 10 days.
President Ashraf Ghani, who took power in September, has vowed to bring peace after decades of conflict.
Richard Galpin, BBC News, Kabul There's been a clear pattern to the Taliban attacks of the past two weeks in the capital. Most have targeted foreigners, military or civilian, whenever and wherever possible.
At first it was the big, heavily fortified compounds on the Jalalabad road where many foreigners live and work, which came under attack. But the militants failed to get inside.
More recently the suicide bombers and gunmen have gone after softer targets, such as the aid agency building which was stormed on Saturday evening leaving three South Africans dead. It had very little protection.
With many Afghans also killed and injured in this spate of attacks, there is an uneasy atmosphere in the capital with people wondering who or what will be targeted next.
It is a set-back for President Ghani who has promised to restore peace to the country. It is also embarrassing for the police, military and intelligence agencies which seem incapable of disrupting the plans of the Taliban suicide bombers.
For now, it's the capital's police chief who seems to have paid the price for this security failure, but there must be other senior officials who bear responsibility.
Gen Zahir was himself the target of an attack in early November, when a suicide bomber infiltrated his offices - supposed to be one of the most secure buildings in Kabul - and killed his deputy. Gen Zahir was not there at the time of the attack.
Spike in attacks
In a spate of attacks in Kabul this week, two American soldiers were killed on Monday and two British embassy workers were killed on Thursday. Dozens of Afghans have also been killed and injured.
Saturday's attack was on a building used by the Partnership in Academics and Development (PAD), a small US education group.
PAD said on it website that three staff members were killed and several others injured in an attack by several gunmen, one of whom detonated a device.
A family spokeswoman, quoted by AFP news agency, named the three dead as Werner Groenewald, 46, who ran the charity, his daughter Rode, 15, and son Jean-Pierre, 17.
The BBC's Richard Galpin in Kabul says it was the deadliest in a series of suicide strikes in the capital over the past fortnight.
A senior Taliban spokesman Zabiullah Mujahid said on Twitter that the target of the attack was a Christian missionary group.
Kabul is regularly subjected to Taliban bombings, with the military, police and government officials all targeted.
This week, Taliban militants also attacked the camp formerly known as Camp Bastion in Helmand province, one month after it was vacated by British forces.
The militants launched an attack late on Thursday night and fighting continued into Friday and on Saturday.
Officials say the militants breached the perimeter fence and accessed a barracks building, killing five Afghan soldiers on Friday. They say that 26 militants were also killed.
On Saturday, in a separate attack on a military base in Sangin in Helmand, 12 Afghan soldiers were killed and one is missing, a spokesman for the Helmand government said.
The Taliban have stepped up attacks in Afghanistan as most foreign combat troops prepare to leave the country next month.
As part of the agreement on the withdrawal of foreign combat troops, some 12,000 Nato soldiers will remain to train and advise Afghan security forces from 1 January.
A separate US-led force will assist Afghan troops in some operations against the Taliban.
JUSTCLICK & CONNECT