The attack on the consulate in Mazar-i-Sharif comes after Prime Minister Narendra Modi's much-hyped diplomatic outreach to arch-rival Pakistan following his first visit to Afghanistan.
"We are being attacked," an Indian consulate official told AFP by telephone from inside the heavily-guarded compound. "Fighting is still going on."
The official, who was hunkered down in a secure area within the complex, said all consulate employees were safe and accounted for.
No group immediately claimed responsibility for the attack, which comes just a day after a deadly assault by suspected Islamist militants on an Indian air base near the Pakistan border.
Also Read
Another official told AFP that government forces had launched an operation to gun down the assailants, but it was not clear if they had managed to breach the consulate.
Vikas Swarup, a spokesman for India's ministry of external affairs, said that no Indian casualties had been reported so far.
The consulate assault is the latest in a series of attacks on Indian targets in Afghanistan.
Nine civilians, including seven children, were killed in August 2013 when suicide bombers targeted the Indian consulate in the main eastern Afghan city of Jalalabad, detonating an explosives-packed car.
The surprise visit immediately followed a whirlwind tour of Kabul, where Modi inaugurated a smart Indian-built parliament complex built at an estimated cost of $90 million, and gifted three Russian-made attack helicopters to the Afghan government.
A day after his visit, Pakistan's powerful army chief General Raheel Sharif travelled to Kabul in a bid to prepare the ground for fresh peace talks with the resurgent Taliban.
Afghan President Ashraf Ghani on Thursday said both sides agreed to hold a first round of dialogue between Afghanistan, Pakistan, US and China on January 11 to lay out a comprehensive roadmap for peace.
least two militants tried to "storm" it last night at around 2115 hours and ITBP guards deployed on the sentry post foiled their attempt by raining heavy fire on them.
They said at least seven Rocket-propelled grenade (RPG) rounds have been fired in the direction of the cosulate but all missed it by a whisker.
"There has been a heavy exchange of fire between the two sides and soon after the Indo-Tibetan Border Police troops fired, the Afghan police forces took charge of the situation. The firing of rockets and bullets is still on," they said.
"The ITBP is on full alert and on standby. The charge is led by Afghan forces and there has been no damage to the staff of the consulate and the diplomats," they said.
ITBP Director General Krishna Chaudhary in Delhi said the force has "secured" the mission area effectively and they were looking forward to get a final word from the Afghan security authorities after they neutralise all the attackers.
Officials privy to the operations said the security forces and the ITBP men had seen two bodies been dragged away last night and it is expected that the attack is the handiwork of at least 5-6 terrorists.
"The Afghan forces are clearing the building where the terrorists are holed up floor by floor. They are now on the last floor," they said.
A strong contingent of over four-dozen ITBP commandos has been securing this facility from 2008 apart from three other missions in the country and the main Embassy in the capital, Kabul.
The security of these sensitive facilities were recently heightened after the ITBP deployed over 35 commandos at Indian missions in Kabul, Jalalabad, Herat, Kandhar and Mazar-i-Sharif.
An incident report in this regard has been submitted by the ITBP to the Union Home Ministry in Delhi.