Afghan and foreign troops fought insurgents who attacked the U.S. embassy and NATO headquarters, spreading fear and confusion and the rise of new questions about the Kabul government's ability to protect the country, even after a 10-year war.
The confrontation ended when the troops finally killed the last two insurgents who had occupied overnight in a high-rise building under construction a few hundred yards from the heavily guarded U.S. embassy.
"The attackers have been killed and ultimate fighting everywhere. There were six terrorists in the building and all are dead," said Interior Ministry spokesman Siddiq Siddiqui told AFP.
Afghan forces at the scene fired guns in jubilation from the top of the building after the assault suffocate, kicking stones and the corpses of the attackers left, an AFP photographer at the scene said.
The Taliban claimed responsibility for the attack.
By holding part of the town hostage for two days in the worst assault on the capital yet - the latest in a series of attacks against Western targets in recent months - the insurgents have demonstrated their growing confidence.
The attack was another sign that security has deteriorated considerably in Kabul, he was beaten with a suicide bombing at the British Council cultural body last month and an assault on a luxury hotel Intercontinental in June.
However, the U.S. ambassadorin Kabul, Ryan Crocker, who played down, although about six rocket-propelled grenades (RPG) landed in the embassy.
"This is really not a very big deal - a difficult day for the embassy and my team," he said in an interview in the media put together.
"Half a dozen rockets fired from 800 yards away, which is not Tet (a key offensive in the Vietnam War), which is harassment."
Crocker blamed the attack on the Haqqani network, a group allied with the Taliban considered the driving force behind the insurgency along the porous Afghan border with Pakistan.
The insurgents, armed with suicide vests and rocket-propelled grenades, unleashed wave after wave of loud explosions and gunfire after the attack began at 1:30 pm (0900 GMT) on Tuesday.
The witnesses told their horror as events unfolded.
"I was sitting in my shop when suddenly I heard an explosion and then another. Then there were gunshots," said Abdulbaqi, a local merchant. "People started running the streets."
Kabul police chief Mohammad Ayoub Salangi told AFP that six attackers inside the building, plus three others behind suicide bombings smaller in other parts of town Tuesday, he was dressed in burkas to prevent searches at checkpoints.
He also claimed that their data showed that mobile phones had been in touch with contacts in Pakistan, where militants are known to have holes in the attacks.
The conflict ended after NATO helicopters International Security Assistance Force (ISAF) were sent to help the Afghan forces, but it was unclear exactly how the last insurgents were killed.
A Taliban spokesman claimed responsibility for the attack through a text message saying that the targets were the headquarters of the ISAF, the agency of the U.S. embassy and intelligence in Afghanistan, the National Directorate of Security (NDS) and other "sensitive sites of government."
ISAF spokesman Lieutenant Colonel Jimmie Cummings said 11 Afghan civilians, including three children died in the fighting.
Siddiqui said that three police officers had also been killed. About 28 people are believed to have been injured, most of them civilians.
Cummings said six foreign soldiers were wounded in the attacks - three U.S. soldiers they were defending the base of the ISAF and other attacks in the operation to clear the work of insurgents.
The NDS Afghan spy agency issued a statement calling on Afghans to be extremely vigilant against the insurgent threat and report suspicious movements "by a sense of national responsibility and moral obligation."
The brazen raid came two months after NATO began a delivery guarantee to Afghan forces, which will be a phased withdrawal of combat troops led by the United States due to the arrival in 2014.
Afghan forces have been in charge of security in Kabul since 2008, but often called for foreign troops, in the event of major attacks.
The U.S. embassy, four Afghans were injured - three to process the visa and a local security guard - but none of the members of U.S. personnel.
The giant, high-security U.S. ISAF borders embassy compound, where thousands of foreign soldiers live and work.