General Zahir Zahir resigned shortly after he confirmed that three South Africans and an Afghan citizen were killed in a Taliban attack yesterday.
Zahir said the head of a foreign organisation, his son and his daughter were all killed, but the identity of the organisation was still not confirmed.
"The attackers first shot dead the director as they entered the building," Zahir said at a press conference, giving no further details.
"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.
The US-led NATO combat mission in Afghanistan will end on December 31 and be replaced by a follow-on mission supporting the Afghan army and police, who have taken over responsibility for thwarting the Taliban.