TV cameras filmed the moment one of the bombs exploded
Taliban gunmen and suicide bombers have attacked buildings in the heart of the Afghan capital, Kabul, setting off explosions and sparking gun battles.
Fighting erupted near the Serena Hotel and the presidential palace, although Afghan President Hamid Karzai says security has now been restored.
The Taliban said 20 of its fighters had taken part in the attack on Kabul.
Two civilians and three security personnel have been killed plus 71 others wounded, officials say.
Seven attackers had also been killed, Interior Minister Mohammad Hanif Atmar said.
AT THE SCENE
John Simpson, BBC News, Kabul
Afghan troops dealt with the attack quickly and impressively, but the fact the Taliban could stage an assault on this scale in the heart of Kabul is deeply disturbing for the government and the multi-national force supporting it.
The attacks were carefully co-ordinated and involved smuggling in at least one and possibly more heavy machine guns plus light weaponry and explosives.
In that sense, the fact that the attack was soon dealt with is far less significant than the fact that the Taliban was able to carry it out.
It was presumably intended to mark the swearing in of President Karzai's new cabinet and no doubt to damage the government in the eyes of the world before next week's international conference.
In the eerie darkness of Kabul I spoke to a group of Afghan special forces who had fought the insurgents - tough impressive men. I asked if the Taliban could win this war. No, they shouted.
But there are other ways to win a war than simply fighting. And persuading the world that the Taliban can strike when and how they want is one of them.
The city is now calm but there is concern that some of the attackers may still be at large.
It is the latest in a series of increasingly brazen attacks on Kabul.
A statement on a Taliban website said the raid had targeted government buildings and the hotel.
The attacks began at about 0950 (0520 GMT) when a suicide bomber detonated his explosives in front of the Central Bank, next to the presidential palace, Afghan security officials said.
Minutes later, two or three suicide bombers plus armed militants took over a multi-storey shopping centre overlooking the presidential palace, and attacked other government buildings and the five-star Serena Hotel.
While security forces lay siege to the shopping centre, a suicide bomber driving a van painted as an ambulance stopped outside another shopping centre nearby and detonated his explosives, officials said.
Intelligence chief Amrullah Saleh said militants next took over a building beside the Ariana cinema and took two children hostage, although they were later released.
Explosions and gun battles then broke out at various locations in the area until security forces declared the situation under control at about 1500 local time (1230 GMT).
The head of US forces in Afghanistan, Gen Stanley McChrystal, praised the work of Afghan forces in quelling Monday's attack.
"Afghan National Security Forces effectively dealt with the situation and should be commended. We convey our heartfelt condolences to the innocent victims of this cowardly attack," he said in a statement issued by the Nato-led International Security Assistance Force (Isaf).
The Taliban fighters were armed with rocket-propelled grenades and small arms, the Isaf statement said.
A statement from the president's office said: "The Afghan president wants to assure the inhabitants of Kabul that the security situation is under control and order has once again been restored."
It added: "The president condemns these terrorist attacks and has instructed the security entities to intensify security in the city and take action to arrest those responsible for these brutal and unpatriotic attacks."
The BBC's Mark Dummett, who had been holed up in the basement of a building in the area during the attack, said the city was in lockdown, with hundreds of security officers patrolling the streets.
He said the discrepancy between the number of insurgents the Taliban said had taken part and the number given by officials suggested there could still be militants at large, and everyone remained on guard.
Speaking to BBC News from inside the ministry of finance, civil servant Emal Masood said he could see that the Feroshgah-e-Afghan shopping centre was burned out.
RECENT KABUL ATTACKS
15 Dec 09: Six killed in suicide attack near hotel in Wazir Akbar Khan district
24 Oct 09: Six UN staff and three Afghans killed in attack on UN guesthouse
8 Oct 09: Suicide bomber attacks Indian embassy, killing at least 17
17 Sept 09: Six Italian soldiers and 10 Afghans die in military convoy blast
18 Aug 09: Suicide blast kills 10 in attack on convoy of Western troops
11 Feb 09: Assault on three government buildings kills 27, including eight attackers
He said: "One of my friends has a shop there. He told me two men entered - insurgents, yes - and were yelling at people to get out of the building. He said he left his shop open and ran away. Police were coming in as he ran out."
The US condemned the attack. Special representative to Afghanistan and Pakistan Richard Holbrooke said: "It's not surprising that the Taliban do this sort of thing. They are desperate people, they are ruthless."
Taliban militants have launched a number of recent attacks on Kabul.
In October, five UN staff were killed in a raid on a UN guesthouse. The Serena Hotel was also targeted in the attack.
Our correspondent, Mark Dummett, says there will be huge concern that the militants have again broken through to the most protected part of the city, although security forces say they do prevent many other attacks.
Monday's attack comes amid continuing political uncertainty in Afghanistan.
Mr Karzai was swearing in new members of his cabinet at the time of the raid.
US envoy Richard Holbrooke: "We can expect this sort of thing on a regular basis"
Afghan MP Daoud Sultanzoy told the BBC it was not a coincidence that the attack started at 1000 local time, "almost exactly the same time that part of the cabinet would have been sworn in only 100m away".
A large number of cabinet posts remain vacant.
Parliament has twice rejected many of Mr Karzai's nominations for a new cabinet, forcing the president to direct deputy ministers or other caretaker figures to run their ministries.
The uncertainty comes ahead of a key conference on Afghanistan in London later this month.
Bookmark with:
What are these?