Fighting between security forces and gunmen was reported to have continued into the early hours of January 4 around the Indian consulate in the northern Afghan city of Mazar-i-Sharif.
Two loud blasts and shots were reported earlier on January 3 when the unidentified attackers had launched a raid on the compound after darkness fell.
A spokesman for the Balkh Province governor said they had been repelled and were now holed up in a house across the street.
At least one civilian was wounded. But no details were immediately available on any other casualties or damage, or on the number of attackers involved. There was no immediate claim of responsibility.
All members of the consulate staff were safe, according to a tweet from Indian ambassador Amar Sinha.
With heavy rain coming down and bursts of firing heard from time to time in the darkness, special forces units prepared an operation to clear the attackers out, police spokesman Shir Jan Durani said.
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 that has killed at least seven military personnel and wounded 20 others.
Despite the attempt by the gunmen to enter the consulate, an Indian official said it was not absolutely certain that the consulate itself was the target. "Details are very sketchy at this point in time," he said.
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.
The 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 AFP and Reuters