As the US-led NATO war against the Taliban nears its end, the insurgents have targeted foreign compounds, embassy vehicles, US troops and a female Afghan member of parliament.
General Zahir Zahir stepped down shortly after he confirmed that three South Africans -- a father and his two children -- and an Afghan citizen were killed in a Taliban attack on a foreign compound on Saturday evening.
"The attack... By multiple gunmen included one who detonated a personal explosive device killing three and injuring other staff members," the website said.
"In the midst of this unprovoked attack, Partnership in Academics and Development remains committed to providing educational resources for Afghan citizens as they become part of the international community."
More From This Section
Zahir said the organisation's local head, his son and his daughter were all killed.
"The attackers first shot dead the director as they entered the building," Zahir said at a press conference, giving no further details about the victims' age.
Fears are growing that the declining international presence is already fuelling the Islamist insurgency.
The mission will be replaced by a 12,500-strong force supporting the Afghan army and police, who have taken over responsibility for thwarting the Taliban.
Kabul police spokesman Hashmat Stanakzai told AFP that Zahir had resigned later Sunday.
"General Zahir Zahir told the interior ministry he no longer wanted to continue his job. The minister has accepted his resignation," Stanakzai told AFP.
Taliban spokesman Zabiullah Mujahid claimed on Twitter that the compound hit on Saturday was that of a secret Christian missionary group and that a meeting of Australian visitors had been hit.
A neighbouring building was engulfed in flames as security forces took three hours to hunt down the militants.
Saturday's attack came two days after the Taliban struck at another foreign guesthouse, wounding a guard, and a suicide bomber targeted a British embassy vehicle in a blast that killed six people.