Heavily-armed gunmen opened fire on the Indian consulate in western Afghanistan Friday, but all diplomatic staff were able to escape unharmed.
Authorities say four men armed with machine guns and rocket-propelled grenades launched the attack in the city of Herat from a nearby building, sparking a gunbattle with security forces. Police say all of the gunmen were killed.
In New Delhi, Indian External Affairs Ministry spokesman Syed Akbaruddin told Indian media that Indo-Tibetan border police were able to hold off the attack before Afghan security forces arrived.
There is no immediate claim of responsibility for the assault.
Afghan President Hamid Karzai's office said he briefed Indian prime minister-elect Narendra Modi by phone on the timely response of Afghan forces and "assured the prime minister and the Indian people of the safety of their citizens in Afghanistan and that no civilian was hurt."
President Karzai said the "attack on Afghanistan, India and our shared interests" would only strengthen the two countries resolve to fight terrorism as a common enemy.
Pakistan's Ministry of Foreign Affairs also issued a statement condemning the attack and expressing "relief that no one from the consulate staff was hurt."
India has invested $2 billion dollars in reconstruction aid to Afghanistan and militants have attacked Indian targets in the country before. In August of 2013, an assault on the Indian consulate in the eastern Afghan city of Jalalabad killed nine people, including several children. Bombings at the Indian Embassy in Kabul in 2008 and 2009 killed at least 60 people. Such attacks have been carried out by the al-Qaida and Taliban-linked militant Haqqani network, which is based in northwestern Pakistan.
Indian national security analyst Sameer Patil (with the Mumbai-based Gateway House) said "anti-India elements in Pakistan may be testing the resolve of India's new government." Longtime rivals India and Pakistan have fought three wars since independence from Britain in 1947.
Friday's violence in Herat comes during the Afghan Taliban's spring offensive. The insurgent group has promised to step up attacks in a bid to undermine the Western-backed government. The Taliban has also pledged to disrupt voting as Afghans prepare for a second round of presidential elections next month.
Afghanistan has seen an increase in insurgent attacks as foreign troops prepare to withdraw from the country by the end of the year.
The U.S. Embassy in Kabul said Friday the United States deplores the Herat incident and other such attacks that "attempt to discourage the international community from continuing our work together with the Afghan people for the further development of Afghanistan."