Taliban militants staged a suicide car bombing and then engaged in a gunfight with security forces outside the American consulate in the western Afghan city of Herat early on Friday.

Police said two Afghan security forces were killed, as were five of the attackers, while the US
said all of its consulate personnel were safe. US Special Forces entered the area to secure the compound, Afghan police said. Qari Yousef Ahmadi, a spokesman for the Taliban, claimed responsibility on behalf of the militant group, which has often staged combined car bomb and gun attacks in the past.

The attack, which also injured several people, underscored the perilous security situation in Afghanistan, where US-led troops are reducing their presence ahead of a full withdrawal planned for next year. The insurgent strikes are no longer concentrated in the country's south and east, but occur with troubling frequency in the north and west, which have been the more peaceful areas in years past.

Friday's assault followed a day and a half of exceptional joy in Afghanistan, where people of all backgrounds were celebrating their nation's first international soccer championship.

The attack began around 6am with the powerful blast. The car bomber detonated his explosives around 60 meters (66 yards) away from the consulate compound, said Sayed Fazlullah Wahidi, the governor of Herat province. Other militants then began firing on security forces in the area.

Footage broadcast on Afghanistan's Tolo television network showed Afghan police dragging away a badly bloodied person from the scene, but it was unclear if he was dead or who he was. Rubble and twisted pieces of metal lay strewn in a seemingly wide area near the consulate, the footage showed.

Gen. Rahmatullah Safi, chief of police in Herat province, initially said an Afghan translator who apparently worked for the consulate died in the attack, but later said that victim was more likely a private security guard working at the compound. An Afghan police officer also was killed, while an unclear number of police, guards and civilians were wounded.

Safi said four militants were killed during the assault, as was the suicide car bomber, but the situation was under control around an hour after the start of the attack.

Robert Hilton, a US Embassy spokesman, said that he had no information about a translator among the victims and that "all consulate personnel are safe and accounted for." He declined to comment on Safi's statement that US Special Forces were combing the area.

Herat lies near Afghanistan's border with Iran and is considered one of the better developed cities in the country, with a strong Iranian influence. The US consulate is located in a relatively sparsely populated part of the city, and the attack took place on Friday, a day of rest in the country.

The Taliban strike was, nonetheless, a stark reminder of the challenges facing Afghanistan in the wake of a rare moment of national unity and joy. On Wednesday and Thursday, Afghans of all ethnicities and ages had poured into the streets to celebrate the national soccer team's 2-0 defeat of India in the South Asian Football Federation Championship.