If the Taliban was trying to play on unease among Afghans and Western governments about the ability of the police and army to safeguard the country, it chose the right target and time.

Foreign troops leave the Intercontinental Hotel at the end of a military… (Pedro Ugarte AFP / Getty…)

Reporting from Kabul, Afghanistan — Nazeer Amiri, an ex-cop out for a leisurely late dinner with friends at a hilltop hotel, could hardly believe his eyes.

Insurgents had burst into the lushly landscaped complex in Kabul, spraying bullets and setting off bombs. Amiri had already seen several bloodied diners crumple to the ground. Afghan police arrived, and he frantically shouted at them to shoot the assailants.

"They ran away and left us there!" he recounted, still incredulous after the nearly all-night siege ended early Wednesday, leaving at least 19 attackers and victims dead. "I saw some of the security forces flee with their weapons. I was begging them to give me their guns, so I could shoot back."

If the Taliban movement was seeking to make the Afghan public and Western governments more uneasy about the ability of the police and army to safeguard the country, it could hardly have picked a more symbolic target or a more sensitive time.

In July the Afghan forces are to begin taking the lead role in policing seven areas of the country, including Kabul, the capital. The process is to culminate in Afghan security forces taking control nationwide by the end of 2014.

With an eye on that date and domestic support for the war rapidly fraying, President Obama last week announced that 10,000 U.S. troops would come home by the end of the year, and 23,000 more by the end of next summer.

Among the guests at the hotel on a warm June night were foreign and Afghan officials planning to attend a conference on the transfer of security responsibilities to Afghan forces.

But the assault provided a reminder of Afghan forces' continuing reliance on the firepower of the NATO-led International Security Assistance Force. Elite New Zealand troops helped quell the attack, New Zealand defense officials said, and helicopter-borne snipers killed three insurgents who had taken refuge on the hotel roof.

As an influx of foreign forces has hurt the Taliban in its heartland in southern Afghanistan, insurgents have turned their focus to areas that had been relatively quiet to show that neither Western nor Afghan forces can secure the country.

In Kabul, foreign forces already have largely faded into the background. Afghan forces provide heavy security at government installations and public places where large groups of people are likely to gather. There are frequent checkpoints on major roads.

No one considered the Intercontinental Hotel a particularly soft target for the insurgents, although it was certainly an inviting one.

An unlovely but enduring landmark in the capital, it has long been a prime gathering spot for Afghan politicians and the city's wealthier classes, a frequent venue for news conferences and internationally sponsored gatherings. Perched on a piece of high ground dominating a western swath of the city, it has a fortresslike aspect, with visitors required to pass through a series of security checkpoints.

After the assault began about 10 p.m., nearby residents turned out to watch red tracer fire streaking over the blackened complex, where authorities cut power to hamper the attackers. Afghans lit up Twitter with accounts with what they could see and hear of the battle.

President Hamid Karzai vowed that the security transition would move forward.

"This attack and all other similar attacks will not prevent the hand-over to Afghan forces," the president said in a statement. He also praised the response of the Afghan police and army to the hotel siege, without mentioning the role of North Atlantic Treaty Organization and other foreign troops.

Foreign military officials also tried to play down their own role and bolster that of the Afghans, issuing a statement praising them for responding "quickly and professionally." Both Afghan authorities and the NATO force painted the battle for the Intercontinental as a victory.

All of the assailants died, eight or nine by the varying accounts of Afghan officials. The country's main intelligence service said the insurgents intended to seize dozens of foreigners and Afghan VIPs as hostages, or to go room by room executing them.

But many in the city were rattled by the ease with which such a large and heavily armed group was able to penetrate a high-profile, well-guarded target and by the fact that Western intervention seemed to have turned the tide.

From the Taliban point of view, the strike, though dramatic, did not cause the hoped-for level of carnage. The insurgent movement sometimes issues highly exaggerated statements that reflect what its commanders would consider a best-case scenario for an assault.

We targeted the enemies with hand grenades and automatic rifles ”

Often, it doesn't even wait until the fighting is over. In this case, the Taliban version included a wildly overblown death toll.

"We targeted the enemies with hand grenades and automatic rifles, and as a result about 50 high-ranking foreigners … were killed," the group said in a statement emailed to reporters.