Noor Khan Nekzad, a regional police spokesman, said the gunmen were holed up in an office belonging to a firm working with foreign forces. He did not have information on casualties. The attack was near Herat airport.
"There was a suicide bomb blast following which the two gunmen entered the facility," added provincial spokesman Mohayddin Noori.
A spokesman for the NATO-led International Security Force (ISAF) in western Afghanistan who declined to be quoted by name said the blast had happened outside the compound of ISAF's Regional Command West.
He added that an ISAF quick reaction force had been deployed but could not confirm comments by Noori that NATO helicopters were providing air support.
The attack is likely to raise further questions about security in the relatively peaceful Afghan province just four months after NATO troops passed control of security in Herat city to Afghan forces.
The July transfer was part of plans to wind down the mainly US foreign combat mission and leave the Afghan government in charge of security across the country by the end of 2014.
One witness, who did not give his name, told AFP he saw several wounded people evacuated after two men with guns and rocket-propelled grenades ran into the office, and then fired at shipping containers.
Attacks on contractors working with ISAF happen relatively frequently.
The Taliban, leaders of the decade-long insurgency in Afghanistan since the late 2001 US-led invasion ousted them from power, were not immediately reachable for comment.
Interior ministry spokesman Siddiq Siddiqui confirmed there had been a "terrorist attack" in Herat but said he did not have further details.