Taliban militants have 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.
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 football championship.
The attack began around 6am with the powerful blast. The car bomber detonated his explosives around 60 metres 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.
General 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.
Gen 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 Gen 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 football team's 2-0 defeat of India in the South Asian Football Federation Championship.