Gunfights have raged as Afghan forces battle to flush out fighters holed up near the Indian consulate in the northern city of Mazar-i-Sharif, hours after they tried to storm the diplomatic mission.

No group has so far claimed responsibility for the raid, as the fighting continued into Monday in the latest in a series of assaults on Indian installations in the country.

Up to six assailants mounted the attack from a building close to the consulate in relatively tranquil Balkh province, prompting Afghan forces to cordon off the area.

Two loud explosions and gunshots were heard as the gunmen launched the attack, Muneer Ahmad Farhad, a spokesman for the Balkh province governor, said.

Al Jazeera's Qais Azimy, reporting from Kabul, quoted police officials as saying that several fully armed men had tried to enter the consulate.

"They faced resistance from the guards and, instead, entered a house about 100 metres from the consulate and opened fire from there," he said. "The house has been surrounded by the Afghan special forces."

He said that some casualties had been reported but initial details were scarce. 

All Indian consular staff were safe, the consul-general confirmed.

Security forces are carrying out door-to-door searches in the area and have not ruled out the presence of more attackers.

"The area is completely blocked by our forces," said Shir Jan Durrani, a police spokesman.

"We are cautiously conducting our clearance operation to avoid any civilian casualties."

 
Sunday's attack came as Indian security forces were still trying to suppress an assault on an airbase near the border with Pakistan that has killed at least seven military personnel and wounded 20 others.

The attack comes amid renewed efforts to reduce long-standing tensions between New Delhi and Islamabad and restart peace talks with the Afghan Taliban.

Narendra Modi visited Kabul and Islamabad last month, the first visit to Pakistan by an Indian premier in more than a decade.

Sunday's attack was not the first time an Indian diplomatic post had been attacked in Afghanistan.

In 2008, a car bomb at the Indian embassy in Kabul killed 60 people and the embassy was again hit by a suicide strike in 2009.

Nine civilians, including seven children, were killed in August 2013 when suicide bombers targeted the Indian consulate in Jalalabad.

In May 2014, gunmen launched a pre-dawn attack on India's consulate in the western city of Herat.

Source: Al Jazeera and agencies