Afghan special forces fought with insurgents barricaded in a house near the Indian consulate in the northern city of Mazar-i-Sharif on Monday after an overnight attack that coincided with an assault on an Indian air base near the border with Pakistan.
A small group of gunmen tried unsuccessfully to break into the consulate late on Sunday, taking advantage of the fact that many people were watching the final of a football championship between Afghanistan and India.
They shut themselves into the house after failing to get into the consulate and battled security forces into the early hours of the morning. Troops were moving slowly to minimise civilian casualties, with operations also hampered by heavy rain.
"The area is sealed off and we are proceeding cautiously and making all possible efforts to protect the lives of those in the area. The attackers will be killed," the provincial governor, Atta Mohammad Noor, said on his Facebook page.
Gunfire rang out as army and police commandos fired rocket-propelled grenades and heavy machine guns at the building and helicopters circled overhead in a residential area of the city, in Balkh province, bordering Uzbekistan.
At least one civilian was wounded and five security force personnel were slightly injured by a hand grenade but the Indian ambassador said all the consulate staff were safe.
Noor blamed "enemies of peace and stability" for the attack, which came amid renewed efforts to lower tension between India and its rival Pakistan and restart peace talks with the Taliban in Afghanistan.
But there was no more concrete indication of who may have been responsible.
Last month, Indian Prime Minister Narendra Modi visited Kabul and Islamabad on the same day, underlining the drive to improve stability and overcome the longstanding hostility in the region.
However, Sunday's attack and a separate assault on an Indian air base in Pathankot, in the northwest Indian state of Punjab, underlined how difficult that process is likely to be.
As the attack in Mazar-i-Sharif began, Indian security forces were still engaged in mopping up the insurgents in Pathankot.
In 2014, India's consulate in the western Afghan city of Herat was hit by heavily armed insurgents including suicide bombers, one of a series of attacks on Indian diplomatic stations in Afghanistan over previous years.
Pakistan has long been suspicious of India's engagement with Afghanistan and its diplomatic presence there.
Short link: