Afghan officials say the siege near India's consulate in northern Afghanistan has ended after all the attackers were killed.
Balkh Governor Atta Mohammad Noor, who had been coordinating the operation in the provincial capital, Mazar-e Sharif, made the announcement on Facebook late on January 4.
The provincial police chief, Sayed Kamal Sadat, confirmed the 25-hour "clearance operation is over" and that the attackers had been killed.
The operation began late on January 3 after gunmen tried unsuccessfully to break into the consulate.
Afghan forces successfully flushed out the militants who were holed up in a building -- located in a residential area -- near the consulate.
Sarwar Hussaini, a provincial police spokesman, was quoted by the Associated Press as saying on January 5 that 10 people were wounded during the clashes, including five civilians who got caught in the crossfire.
Hussaini said there were three gunmen and all were killed.
Earlier, Muneer Ahmed Farhad, the government spokesman in Balkh Province, told RFE/RL's Radio Free Afghanistan that at least two members of the Afghan security forces had been killed.
The Indian ambassador said all the consulate staff were safe.
There was no immediate claim of responsibility for the attack, which is the latest in a series of assaults on Indian installations in Afghanistan.
The incident occurred while Indian security forces were still trying to suppress an attack on an air base in Pathankot, near the border with Pakistan.
In 2008 a car bomb at the Indian Embassy in Kabul killed 60 people and the facility was again hit by a suicide strike in 2009.
Nine civilians, including seven children, were killed in August 2013 when suicide bombers targeted the Indian Consulate in the eastern city of Jalalabad.
In 2014, India's consulate in the western Afghan city of Herat was hit by heavily armed insurgents including suicide bombers.
The most recent attack came amid renewed efforts to reduce long-standing tensions between New Delhi and Islamabad and restart peace talks with the Afghan Taliban as part of a broader drive to improve stability in the region.