Hours after rockets were fired at foreign diplomatic facilities and the Afghan security headquarters here, Secretary of State Condoleezza Rice arrived in the Afghan capital Wednesday for talks about ongoing military operations and efforts to stabilize the country's fragile new democracy.

Rice's visit, the first by a senior U.S. official since Afghanistan's parliamentary elections last month, also came as six Afghan soldiers and five Afghan aid workers, including two doctors, were killed in attacks Wednesday blamed on insurgents from the Islamic extremist Taliban militia.

At a joint news conference with Afghanistan's President Hamid Karzai, Rice said Afghanistan was "inspiring the world with its march of democracy." The parliamentary elections, held without major incident, were the last step in the U.N.-guided political transition that followed the ouster of the Taliban in late 2001.

Final results are not yet in, but partial tallies show that the legislature will include a number of former Islamic militia leaders, some of whom are accused of widespread abuses during the civil war in the early 1990s. They will be joined by former communist figures, women's rights advocates and Western-educated technocrats.

Rice, who made a brief stop here during a tour of Central Asia, played down the spate of post-election attacks that included the assassination of one candidate, several suicide bombings and an ambush Monday that killed 19 members of the new national police force.

"The attacks after the elections are a clear indication of the frustration that exists" because of the successful political process, she said after meeting with Karzai.

But her visit underscored the challenges in Afghanistan, which has received decreasing attention as the Iraq war has escalated. This year has been the deadliest yet for American troops in Afghanistan, with 84 killed. Altogether, clashes and attacks by Islamic insurgents have claimed more than 1,300 lives in 2005.

In the newest attacks Wednesday, presumed Taliban gunmen killed two physicians, two nurses and a driver working with Afghan Help Development Services, firing on their vehicle as they returned from a refugee camp in southern Kandahar province, a director of the agency said.

In the capital, a rocket exploded before dawn outside the Canadian ambassador's residence in a secured diplomatic enclave, wounding two guards, one seriously. A second rocket landed on a government intelligence office, but no one was injured.

Later in the day, six government soldiers were reported killed in a Taliban ambush in the central province of Uruzgan.

Unlike on previous trips to the country, foreign reporters traveling with Rice were compelled to wear bulletproof vests, and armed guards rode with them in buses from the airport to the presidential palace in Kabul.

Rice emphasized that the United States, which has more than 18,000 troops in Afghanistan, remained committed to the country and would not abandon Afghanistan as it did after 1989, when Soviet troops withdrew.

"The Afghan people have nothing to worry about," she said. "America is going to be in and with Afghanistan as long as we are needed."

The Bush administration has been hoping to reduce the size of its military force here in the coming months and is looking for its NATO allies to take over more counterinsurgency work against Taliban and al Qaeda forces, officials have said.

But Rice said U.S. forces would remain "to make certain that they defeat the terrorists and Afghanistan becomes a place of stability and progress."

Rice and other officials have said the primary U.S. goals in Afghanistan now are to help end violence, stabilize the economy and reduce widespread opium production that makes Afghanistan the world's largest producer of narcotics.

Karzai, speaking about Monday's attack on police in Helmand province, suggested that there had been "cooperation between the drug trade and terrorism." He said fighting drugs was essential.