KABUL, Afghanistan — Teams of insurgents firing rocket-propelled grenades and automatic weapons struck at the U.S. Embassy, NATO headquarters and other buildings in the heart of the Afghan capital Tuesday, raising fresh doubts about the Afghans’ ability to secure their nation as U.S. and other foreign troops begin to withdraw.

Seven Afghans were killed and 15 wounded in the coordinated daylight attack, which sent foreigners dashing for cover and terrified the city from midday well into the night as U.S. helicopters buzzed overhead. No embassy or NATO staff members were hurt.

Late Tuesday, at least two gunmen remained holed up on the top floors of an apartment building from which they and other militants had attacked the heavily fortified embassy.

The militants’ seeming ability to strike at will in the most heavily defended part of Kabul suggested that they may have had help from rogue elements in the Afghan security forces. The attacks also coincided with suicide bombings elsewhere in the capital – the first time insurgents have organized such a complex assault against multiple targets in separate parts of the city.

The Taliban claimed responsibility for the attack, though Kabul’s deputy police chief said he thought an affiliated organization, the Haqqani network, carried it out.

The Taliban and related groups have staged more than a dozen assaults in Kabul this year, including three major attacks since June. That represents an increase from years past and is clearly intended to offset U.S. claims of weakening the insurgents on southern battlefields and through hundreds of night raids by special forces targeting their commanders.

The Obama administration declared that it wouldn’t allow Tuesday’s attack to deter the U.S. mission in Afghanistan, warning the attackers that they would be relentlessly pursued.

Even so, the U.S. Embassy in Kabul canceled all trips in and out of Afghanistan for its diplomats, and suspended all travel within Afghanistan.

High blast walls ring the embassy compound, and there was little damage to the reinforced concrete buildings, many of which are surrounded by sandbags.

Four Afghans were wounded when a rocket-propelled grenade hit the original U.S. Embassy building next to the new embassy, CIA Director David Petraeus told lawmakers on Capitol Hill. Among them was a young girl who was with a group waiting for visas outside the embassy, he said.

Afghan officials said the violence around Kabul resulted in the deaths of three police officers and four civilians. Four of the wounded were caught up in attempted suicide bombings. Six insurgents were also killed, police said.

Officials said the attack began just after noon when a car was stopped at a checkpoint at Abdul Haq square.