Two Spanish police officers who were injured succumbed to their injuries, the Spanish government said on Saturday.
Early Saturday, the Afghan government announced that the siege had ended.
"Afghan Police Special Forces have killed all the attackers who were involved in last night terrorist attack in Kabul," information ministry spokesman Sediq Sediqqi said in a tweet.
The Taliban claimed responsibility for suicide attacks in Kabul's Sherpoor area Friday. Spokesman Zabiullah Mujahid said, "Suicide attacks started on a guesthouse of invaders in the Sherpoor area of Kabul in the evening."
Spanish Prime Minister Mariano Rajoy called the assaults in Kabul's Sherpoor district a terrorist attack, telling reporters that it appeared to have targeted guesthouses near the Embassy.
Although the Afghan government hasn't confirmed any casualties, information from the Spanish government and an aid group suggested at least eight people were injured.
Taliban spokesman Mujahid said there were heavy casualties.
Video distributed by Reuters news agency showed many security personnel in the area after darkness fell.
The Sherpoor district hosts not only embassies, but also the homes of many expatriates.
Rajoy, speaking in the Spanish port city of Alicante, told reporters that a Spanish police officer was injured.
Emergency, an Italian aid group that runs a hospital about 700 meters from the Spanish Embassy, said it received seven Afghan patients after the assault.
The anonymous source said most of the Spanish Embassy's staff were in a safe place, though officials still were trying to account for the whereabouts of all personnel.