KABUL, Afghanistan — Three suicide attackers killed at least nine civilians, most of them children, in a botched attack today on the Indian consulate in an eastern Afghan city near the border with Pakistan, security officials said.

Militants, mostly smaller groups based in Pakistan, have targeted Indian diplomatic interests multiple times in recent years.

In the latest attack, police fired on the militants as they approached a checkpoint outside the consulate in Jalalabad, prompting one of them to set off their explosives-laden car, said Masum Khan Hashimi, the deputy police chief of Nangarhar province.

The blast killed nine bystanders, and wounded another 24 people including a policeman. Six of the dead and three of the wounded were children, said Jalalabad hospital director Dr. Humayun Zahir. He did not give their specific ages.

All three attackers also died, although it was not clear how many were killed by police fire and how many by the explosion.

In New Delhi, India’s External Affairs Ministry spokesman Syed Akbaruddin said that all Indian officials in the consulate were safe.

Afghanistan’s main insurgent group, the Taliban, denied in a text message that it had carried out the attack.

Militant groups known for attacking Indian interests include Lashkar-e-Taiba, blamed for the 2008 attack on the Indian city of Mumbai that killed 166 people. LeT has been active in Afghanistan in recent years, often teaming up with insurgent groups operating in the eastern part of the country near the frontier with Pakistan. Last year the U.S.-led military coalition arrested a senior LeT leader in eastern Afghanistan.

India has been frustrated by Pakistan’s failure to crack down on Lashkar-e-Taiba, which has strong historical links with Pakistani intelligence. Pakistan has always viewed India as a potential rival in Afghanistan, which it considers its strategic backyard.

“Such coward attacks will not deter India from providing reconstruction and developmental assistance to our true friend, Afghanistan,” the Indian Embassy tweeted in reaction to the consulate bombing.

Hashimi said the Jalalabad attack began when three men in a car approached the checkpoint. Two of the men got out of the car wearing vests rigged with explosives and a police guard immediately opened fire on them, Hashimi said. He added that the third man then detonated a large bomb located inside the car.

In 2010, two Kabul guest houses popular among Indians were attacked, killing more than six Indians. India blamed that attack on LeT.

The Indian Embassy was bombed in 2008 and again in 2009, leaving 75 people dead in the two attacks.

In other violence in the same province, 22 police officers and 76 Taliban were killed in the Sherzad district of Nangarhar in two days of battles with insurgents that broke out when militants shot a tribal elder, officials and police said.

The militant death toll could not be checked independently, but four separate officials confirmed the police death toll.

Fighting has intensified in eastern and southern parts of Afghanistan in recent months, especially since the mid-June handover of security responsibilities from the U.S.-led international military coalition to the Afghan national security forces. The Taliban have been fighting to regain ground they lost in the past three years to foreign forces, and violence is expected to spike again after the end of the Muslim holy month of Ramadan.

So far this year, a total of 613 Afghan and 470 Afghan soldiers have been killed in fighting.