Four insurgent gunmen launched a pre-dawn attack on India's consulate in the western Afghan city of Herat yesterday before being repelled by security forces, highlighting instability as Nato troops withdraw.
There were no casualties among Indian staff but at least one policeman was wounded when the attackers stormed a house close to the consulate and opened fire on the building.
Afghanistan is in the middle of elections to choose a successor to President Hamid Karzai, who has ruled since the fall of the 1996-2001 Taliban regime.
"Four Taliban attackers entered a residential house behind the consulate in the early morning," said Mohammad Yousuf Pashtoon, commander of Herat's paramilitary Quick Reaction Force. "Security forces evacuated residents from the building and fought to clear the building."
The interior ministry said all the insurgents had been killed but sporadic gunfire continued at the scene.
India has been a key supporter of Kabul's post-Taliban government, and analysts have often pointed to the threat of a "proxy war" in Afghanistan between India and its arch-rival Pakistan.
Pakistan was the Taliban's main ally and the Pakistani security forces have often been accused of assisting the insurgents, especially with attacks on Indian targets in Afghanistan.
The Pakistani government issued a swift condemnation of the attack, saying it was opposed to "terrorism in all its forms and manifestations".
The Taliban did not immediately claim responsibility for the attack, which came after incoming Indian prime minister Narendra Modi invited Pakistan premier Nawaz Sharif to his inauguration in Delhi next week.
"One gunman was shot by the ITBP [Indo-Tibetan Border Police] while they were trying to breach the consulate," Indian foreign ministry spokesman Syed Akbaruddin said.
He added that Indian and Afghan security forces had been "successful in rebutting this attack".
Yesterday's assault in Herat is the latest in a long line of attacks against Indian targets in Afghanistan.
Nine civilians, including seven children, were killed in August last year when suicide bombers targeted the Indian consulate in the eastern city of Jalalabad, detonating an explosives-packed car.
In 2008, a car bomb at the Indian embassy in Kabul killed 60 people and the embassy was again hit by a suicide strike in 2009. And in 2010, two guesthouses in Kabul used by Indians were attacked.