Taliban insurgents in Afghanistan have attacked the US consulate in the western city of Herat.
The Taliban told the BBC a suicide bomber had detonated explosives outside the building before dawn on Friday.Other fighters then opened fire on the consulate. Several Afghan police are reported to have been killed and injured in the gun battle.
It is the latest in a series of attacks ahead of the withdrawal of foreign combat troops from Afghanistan in 2014.
An Afghan army spokesman told the BBC that the initial explosion had damaged outer defences of the US consulate, allowing the attackers to breach the perimeter and shoot at the consulate buildings. The bomb had been placed in a vehicle.
"A truck carrying attackers drove to the front gate, and attackers, possibly firing rocket propelled grenades and assault rifles, commenced attacking Afghan Protective forces on the exterior of the gates," US State Department spokeswoman Marie Harf told reporters.
"Shortly after, the entire truck exploded, extensively damaging the front gate [to the consulate]," she added.
The gunfire continued for some time, reporters at the scene said.
The Nato-led International Security Assistance Force (Isaf) tweeted at 0400 GMT that the consulate was secure "with all enemy forces being killed". Isaf and Afghan National Security Forces were at the scene, it added.
The BBC's David Loyn in Kabul says the attack - carried out in the shadow of the anniversary of the 9/11 attacks on the US - is a demonstration of the ability of insurgents still to disrupt Afghanistan 12 years on.
Two Afghan policemen and a consulate guard were killed in the fighting, and 17 civilians have been injured, including women and children, our correspondent adds.
"All consulate personnel are safe and accounted for," a US Embassy spokesman told AP news agency.
Peter Bezaorowajnyj, who works in Afghanistan, told the BBC he could see smoke from the explosion from the roof of his building.
The explosion "rocked the building I am staying in", he said.
Herat, close to the Iranian border, has been relatively peaceful in recent years.
Earlier this month Taliban targeted the Torkham US base in eastern Afghanistan, sparking a lengthy gun battle in which three insurgents were killed.
Are you in the area? Did you witness the attack? You can send us your experiences using the form below.
SOURCE: BBC