Correction: An earlier version of this article incorrectly attributed a quotation. It was Simon Gass, NATO’s senior civilian representative in Afghanistan, not U.S. Gen. John Allen, the top NATO commander in Afghanistan, who said: “Yesterday’s attack was a fleeting event; it came and it went.” This version has been corrected.

— The top U.S. officials in Afghanistan sought on Wednesday to portray a deadly and sustained 20-hour attack on the U.S. Embassy and other targets as evidence that Afghanistan’s security forces are increasingly competent and that the Taliban is on the defensive.

Gen. John Allen, the top NATO commander in Afghanistan, said the Pakistan-based Haqqani network, a sophisticated insurgent group closely affiliated with the Taliban, probably carried out the brazen attack, which began Tuesday. Afghan and NATO troops killed the last assailant about 9:30 a.m. Wednesday.

Allen said insurgents scored a propaganda victory with the attack, which was the most sustained and widespread in the capital since the fall of the Taliban in late 2001. But he said it accomplished little else.

“The insurgents are on the defensive,” he told reporters Wednesday afternoon.

The general said the performance of Afghan security forces during the attack should tell Afghans “that they can sleep well at night.”

Simon Gass, NATO’s senior civilian representative in Afghanistan, said, “Yesterday’s attack was a fleeting event; it came and it went.”

Afghan and U.S. officials provided a more complete account Wednesday of the coordinated attack, which paralyzed Kabul for almost an entire day as American diplomats and NATO personnel took cover from volleys of gunfire and grenades lobbed from an unoccupied building overlooking the U.S. Embassy and NATO headquarters.

Officials said seven assailants apparently wore burqas to evade checkpoints and managed to stockpile weapons, including rocket-propelled grenades, inside the tall building, which is under construction.

“We strongly believe they used burqas to reach this place,” Afghan police spokesman Sediq Sidiqqi said outside the building, referring to the loose-fitting garment that covers women from head to toe. “The police respect the women too much.”

Contrary to early reports, the assailants did not appear to be wearing suicide vests. Shortly after Afghan and NATO troops finished clearing the building, Afghan police let reporters survey the structure. The bodies of the men were sprawled on the floor.

As the battle raged, four suicide bombers detonated explosives elsewhere in the capital, authorities said. The Tuesday attacks killed 11 Afghan civilians and five policemen, they said. Five children were among the dead. Nearly 20 Afghan civilians were wounded.

Three NATO troops were wounded while clearing the building near the embassy, and three others were injured when grenades landed on a nearby military base, NATO officials said.

U.S. Ambassador Ryan C. Crocker played down the significance of the embassy attack, dismissing the assailants as a small group of men who “rumbled into town with RPGs under their car seats.”

“This is not a very big deal, a hard day for the embassy and my staff, who behaved with enormous courage and dedication,” Crocker said. “But look, you know, a dozen RPG rounds from 800 meters away — that isn’t Tet. That’s harassment.” He was referring to the 1968 Tet Offensive during the Vietnam War, a nationwide attack on U.S. and South Vietnamese forces by more than 80,000 communist Vietnamese troops.

Allen said insurgents are losing support among the population and confidence in their leaders, many of whom operate out of the relative safety of ungoverned areas in Pakistan near the Afghan border.

In a statement asserting responsibility for the attack, the Taliban characterized similar comments attributed to Allen in the past as displays of hubris.

The statement said the assault showed that the militant group remains strong, determined to expel foreign troops from Afghanistan and capable of striking in the heart of the capital.

The hours of gun battles and explosions unnerved Kabul residents, who are normally steely, having lived though decades of war. Many said the attackers must have been aided to some extent by elements of the Afghan government.

“If the government officials do not have a hand in this, how come they managed to transport the arms and heavy weapons?” demanded Abdul Habib Andiwal, a politician from Zabul province who recently lost his seat in parliament.

Special correspondents Sayed Salahuddin and Javed Hamdard contributed to this report.