As the battle stretched into the afternoon, soldiers entered the building, a large structure formerly used as an office by US development agency USAID, where between four and six attackers had locked themselves inside a safe room.
The attack began late on Sunday after gunmen tried unsuccessfully to break into the consulate, taking advantage of the fact that many people were watching the final of a football championship between Afghanistan and India.
After a heavy exchange of fire that went on until well into the night, security forces suspended operations before resuming in the morning, firing rocket-propelled grenades and heavy machine guns at the building.
"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 a helicopters circled overhead in a residential area of the city, in Balkh province, bordering Uzbekistan.
At least four civilians and six security force personnel were wounded but the Indian ambassador said all the consulate staff were safe.
There was no confirmation of any killed or wounded among the attackers.