All the diplomatic staff were safe.
Three gunmen were killed, one by ITBP (Indo-Tibetan Border Police) and two by Afghan police, out of four attackers who struck the Consulate which houses two buildings, Indian Ambassador to Afghanistan Amar Sinha said.
In a pre-dawn assault, the gunmen attacked the building which houses the residence of Consulate General, Sinha said, adding that there were nine Indians in the mission apart from local Afghans.
One attacker was killed while climbing the wall to enter the premises of the consulate, Sinha said.
More From This Section
The spokesperson said that operation is underway.
"India-Afghanistan officials (were) in touch on attack on India's Consulate in Herat. Foreign Secretary Sujatha Singh (was) monitoring (the) situation," the official said.
Afghan police officials earlier said gunmen armed with machine guns and rocket-propelled grenades opened fire on the consulate early this morning from a nearby home. One attacker is still firing.
No group has claimed responsibility for the attack.
In August last year, a failed bombing against the Indian Consulate in Jalalabad city near the border with Pakistan killed nine people, including six children. No Indian officials were hurt.
The Indian Embassy in Kabul was attacked twice in 2008 and 2009 that left 75 people dead.
India has invested in some major infrastructure projects in Afghanistan like Salma hydroelectric dam in Herat province and the Afghan parliament building in Kabul.
India's development assistance programme for Afghanistan currently stands at USD two billion, making it the leading donor nation among all regional countries.