The Islamic State group Sunday claimed responsibility for an attack that killed 10 people and trapped around 2,000 for hours inside the communications ministry in the Afghan capital the previous day.
Four IS jihadists detonated explosives near the ministry, then entered and "battled Afghan security forces with machine guns and hand grenades for numerous hours", the group said in a statement on its social media channels.
The attack in central Kabul killed seven civilians and three members of the security forces, the interior ministry said on Sunday, in a new toll after three people died of their wounds.
AFP journalists heard one big blast around 11:40 am (0710 GMT), followed by sporadic gunfire for hours afterwards.
By about 5:00 pm (1230 GMT), the interior ministry declared the assault over.
"All suicide bombers killed & more than 2000 civilians staff rescued," it said on Twitter.
General Sayed Mohammad Roshan Dil, the Kabul police chief, said the four attackers had been wearing police uniforms.
Panicked workers inside the 18-storey building, believed to be Kabul's tallest, scrambled up to the top floor as the fighting raged below.
One woman said she had been in a group of about 30 people on the 10th floor when the assault started, then was told to move up to the 18th floor as gunfire increased. They were all eventually rescued by commandos.
Aside from a grenade attack on a military vehicle last week and persistent crime, Kabul has in recent weeks enjoyed a period of relative calm.
Last year however saw a string of attacks including one where a massive bomb concealed in an ambulance killed more than 100 people.