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 January 4.
The provincial police chief Sayed Kamal Sadat confirmed the 25-hour "clearance operation is over" and that all four militants 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.
Earlier, Muneer Ahmed Farhad, the government spokesman in Balkh Province, told RFE/RL's Radio Free Afghanistan that at least two Afghan security forces had been killed.
A local health official said three civilians and six soldiers had been wounded and were being treated in hospital.
No group has so far claimed responsibility for the attack, the latest in a series of assaults on Indian installations in the country.
The attack followed an insurgent attack over the weekend on an air force base in the northern Indian state of Punjab.
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 longstanding 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.
With reporting by AP, AFP, and Reuters