-- A powerful car bomb exploded at dusk Sunday outside the downtown office of a U.S. security contracting firm and an adjacent building where Afghan police are trained. Officials said that at least four people were killed and that at least two of them were Americans.

The blast, which engulfed the police facility in flames, shattered office and store windows for three blocks in all directions. It was the deadliest bomb to strike this rapidly developing postwar capital in two years, and it came days before campaigning begins for the country's first-ever presidential elections in October.

Extremist Islamic groups have vowed to disrupt the elections through violence, and within two hours of the explosion, purported spokesmen for the Taliban Islamic militia had claimed responsibility for the bomb attack in telephone calls to two news agencies.

The office of President Hamid Karzai issued a statement Sunday night saying the blast had killed seven people: two Americans, three Nepalese guards and two Afghans, one of them a young boy. Security agencies could confirm only four deaths, however.

"The president understands that as the people of Afghanistan move towards elections, the enemies of Afghanistan will expedite their efforts to harm the election process and threaten the people's security," the statement said, adding that Afghanistan will continue "relentlessly" on a path to peace and reconstruction.

A bombing several hours earlier killed nine people at a school in the southern province of Paktia, Afghan officials said. The victims were as young as 7. The school was in Zurmat, a town that has been a site of recurrent clashes between alleged Taliban fighters and U.S. and Afghan troops.

DynCorp Inc., the Reston-based security firm whose office was apparently targeted by the bomber in Kabul, provides a large team of private guards for Karzai, who shifted from Afghan guards shortly after the assassination of Vice President Abdul Qadir in July 2002.

The blast occurred in front of an adjacent building in which foreign security experts are training Afghan police recruits. The U.S. ambassador, Zalmay Khalilzad, said in a statement that the bombing appeared to have been aimed at the security firm but that it would not set back efforts to build a secure environment in the country, which was devastated by 23 years of conflict.

"This cowardly attack will not deter U.S. participation in the ongoing effort to help Afghanistan stand on its own feet," Khalilzad said. "Rebuilding Afghanistan's security institutions is a vital step toward the creation of a secure, peaceful country. . . . The training of police and the army will continue to go forward."

Kabul's police chief, Gen. Baba Jan, told reporters near the blast site that some of the dead and injured people had been taken to hospitals and that some were foreigners, but he did not give exact numbers or nationalities.

"There was an explosion, there was damage, there are bodies. . . . We do not know who did this action," Jan said, standing at a traffic circle that was clogged with wailing ambulances, military tanks driven by international peacekeeping troops and city buses crowded with passengers during rush hour.

None of the victims was publicly identified, and reporters were kept away from the scene by dozens of Afghan police, foreign peacekeeping troops and U.S. security forces in plainclothes carrying assault rifles.

A spokesman for California-based Computer Sciences Corp, which is DynCorp's parent company, said he could "confirm that a DynCorp office in Kabul was the target of an apparent car bombing" in which there were "a number" of casualties.

The spokesman said that the company was "working to confirm the number and identities of the victims," and that the organization's "operations in Afghanistan are continuing."

Witnesses, including passersby who helped carry victims to ambulances, said the office building burned for an hour and that several bodies lay on the street in front. The blast, which occurred around 5:45 p.m., could be heard at least one mile away.

The bomb appeared to have exploded inside a Toyota Corolla sedan, a common model here. The car's charred wreck lay just outside the building that housed DynCorp, but it was not clear whether a driver had been inside. One purported Taliban spokesman said the attack had been a suicide bombing. Later, however, a Taliban spokesman told the Reuters news agency that the car bomb had been detonated remotely.

Police wielding riot sticks kept crowds of bystanders from the bomb site, while merchants on a half-dozen surrounding blocks swept up piles of jagged glass. Many windows and the entire glass lobby of a new 10-story office building were shattered.

"I heard a very, very loud sound and saw all my windows breaking. Then someone came in and asked for help. He was bleeding from his head and hands and leg," said Mauladat, 45, who owns a pharmacy one block from the bombing.

The Shar-I-Nau district, where the bomb exploded, is one of the most affluent commercial areas of Kabul. It houses international aid agency offices, inns and apartments, restaurants that cater to foreigners, Internet cafes, carpet shops, several embassies, doctors' offices and travel agencies.

"This work is my responsibility. The enemies of Afghanistan do not want it to be reconstructed, but the work will continue," vowed Mahmad Rassool, construction supervisor for the Kabul City Center office building. The new lobby gaped open, and thousands of pieces of thick green glass littered the sidewalk around it.

The afternoon school bombing in Paktia occurred in a relatively remote part of the country, and few people in Kabul were aware it had happened when the evening blast shook the capital. Officials in Paktia said one adult and eight children were killed, and they speculated that the school was targeted because it received foreign financial aid.

Attacks by Islamic extremists have increased recently as Afghanistan's historic election approaches. Vehicles carrying election workers have been bombed, and 12 Afghan election workers have been killed in rural areas.

The Taliban, a radical armed Muslim movement, seized power in most of Afghanistan in 1996 but was driven from power by a U.S.-led military intervention in 2001. U.S. troops have been hunting down remnants of the Taliban ever since, but its guerrilla fighters have regrouped and staged dozens of attacks on aid workers, U.N. offices and Afghan government facilities.

Almost all the attacks have occurred in rural areas, and few have taken place in the capital, which is patrolled by more than 4,000 peacekeeping troops provided by NATO. Western governments have pledged to step up the number of troops in October to help protect the elections.

Staff writer Martin Weil in Washington contributed to this report.

An Afghan police officer and an American security guard try to maintain order after a bomb exploded outside the Kabul office of DynCorp Inc.Afghans inspect the wreckage of a school destroyed by a bomb in the southern town of Zurmat. One adult and eight children were killed.