An Afghan official says special forces have ended the standoff with gunmen holed up near the Indian Consulate in the country's north and have killed all the attackers after a 24-hour gunbattle.

The standoff began on Sunday night in the city of Mazar-i-Sharif, when three gunmen tried to storm the consulate, then retreated into an adjacent, four-story building. Later, Afghan troops rappelled from helicopters onto the roof of the building to drive out the gunmen.

Sarwar Hussaini, a police spokesman in northern Balkh province, said on Tuesday that the standoff ended late Monday night.

He says there were three gunmen and all were killed. Ten people were wounded during the clashes, including five civilians who got caught in the crossfire.

No one has claimed responsibility for the attack.