While allowing that the shared intelligence was not perfect, NATO officials emphasized that there was nothing harder than pre-empting attacks, and said that “9 times out of 10,” the Afghans and their Western allies had prevented attacks that the public never learned about.

“There is no intelligence service that gets all the threats, but the enemy gets to choose the place and time,” said Lt. Col. Jimmie Cummings, a NATO spokesman in Kabul.

Colonel Cummings noted that Sunday’s attacks were the first major coordinated assaults in Afghanistan since Sept. 13, when men linked to the Haqqani network struck at the American Embassy in Kabul and the nearby NATO headquarters, ultimately to little effect.

A senior NATO official said there had been at least a few instances since then when NATO and Afghan forces, acting on intelligence, had intercepted, in or near Kabul, supplies and fighters who were preparing to carry out attacks. The official did not provide details and, as with several others interviewed for this article, spoke on the condition of anonymity in order to discuss classified intelligence.

Privately, however, American and Western officials were more blunt in their self-criticism, in an almost grudging respect for their foe. “It was not lost on anybody that these were very well-coordinated, well-timed attacks,” a senior American official said. A Western official added, “We had general indications that they were planning something in April, but nothing specific enough to actually act on.”

While it is true that it is all but impossible to intercept every terrorist attack, there was not one attack on Sunday, but at least seven — three in Kabul, two in Jalalabad, one in Paktia Province’s capital, Gardez, and another in Logar Province’s capital, Pul-e-Alam. There would have been dozens more people involved than just the assailants who struck on Sunday.

The nearly 40 fighters who took up positions in vacant buildings in strategic locations in the four provinces were the tip of the iceberg, while the bulk of the terrorist activity that made their attacks possible was hidden: the financers, trainers, reconnaissance agents who chose the sites, logistics experts who arranged transport, and the weapons suppliers who provided what they needed for the attack.