The Indian consulate in Afghanistan came under attack on Sunday as gunmen attempted to enter the compound following twin explosions, a spokesman for the local governor said.

Afghan security forces battled a group of gunmen near the consulate in the northern city of Mazar-i-Sharif, officials said, as gunfire and rocket-propelled grenades rocked the surrounding area.

The attack, launched from a nearby house, came as Indian security forces were still trying to suppress an assault on an air base near the border withPakistan that has killed at least seven military personnel and wounded 20 others.

With an unknown number of gunmen holed up in the house across the street from the consulate, special forces units prepared an operation to clear the attackers, police spokesman Shir Jan Durani said.

No details were immediately available on any casualties or damage or on the number of attackers and there was no immediate claim of responsibility.