Afghan police say at least three gunmen have attacked India's consulate in the western province of Herat, using machine guns and rocket propelled grenade launchers.
Police say two attackers were killed by security forces shortly after the attack began, while a third -- and possible a fourth -- continued to fire at Afghan troops in the late morning hours of May 23.
Abdul Sami Qatra, Herat’s provincial police chief, said one of the slain attackers was a suicide bomber.
Qatra said that all of the workers inside the consulate compound were safe.
Syed Akbarrudin, a spokesman for India’s Ministry of External Affairs, also confirmed on Twitter that all of India's diplomatic staff at the consulate were safe.
No group immediately claimed responsibility for the attack.
New Delhi has previously accused Pakistan's security services of being behind attacks on Indian targets in Afghanistan.
The latest assault comes only days after India's incoming Prime Minister Narendra Modi invited Pakistan's Prime Minister Nawaz Sharif to his May 26 inauguration ceremony in New Delhi.
Bilateral relations between India and Afghan President Hamid Karzai’s government in Kabul have been friendly.
India aided the overthrow of the Taliban regime in Afghanistan and is the largest regional provider of humanitarian and reconstruction aid to the country -- with more than $2 billion in projects that include roads and power plants.
India's four consulates in Afghanistan are located in Herat, Mazar-i-Sharif, Kandahar, and Jalalabad.
Foreign embassies and consulates remain a favorite target of insurgents in Afghanistan, but many are protected by high walls and multiple gates, as well as security forces.
In August 2013, an attempted bombing of the Indian consulate in Jalalabad near the border with Pakistan killed nine people, including six children.
No Indian officials were hurt in that botched attack.
Attacks on the Indian Embassy in Kabul in 2008 and 2009 killed 75 people.
One group known for targeting Indian interests in Afghanistan is Lashkar-e-Taiba, which India blames for the 2008 attack on the Indian city of Mumbai that killed 166 people.
Another is the Haqqani network, which is based in Pakistan's lawless tribal areas along the border with Afghanistan.
Lashkar-e-Taiba has been active in Afghanistan in recent years, often teaming up with insurgent groups that operate in the eastern part of Afghanistan near the border with Pakistan.
In 2010, two Kabul guest houses popular among Indians were attacked, killing more than six Indians. India blamed that attack on Lashkar-e-Taiba.
Pakistan has alleged that India, its regional rival, uses its consulates and construction projects in Afghanistan as cover for spy operations.
New Delhi vehemently denies that charge.
With reporting by AP, Reuters, and AFP