Police said two Afghan security forces were killed, as were five of the attackers, while the U.S. said all of its consulate personnel were safe. 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 U.S.-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 6 a.m. 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 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 U.S. Embassy spokesman, said he had no information about a translator among the victims and that "all consulate personnel are safe and accounted for."
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 U.S. consulate is located in a relatively sparsely populated part of the city, and the attack also took place on Friday, a day of rest in this 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.
Associated Press writer Nahal Toosi contributed to this report.