Afghan military personnel take position at the scene of an attack on the Indian consulate in Herat on May 23 ,2014

The Indian consulate in the Afghan city of Herat was attacked early this morning by four gunmen who tried to enter the complex and later fired from neighbouring buildings. Three attackers have reportedly been killed.The assault, which began at 3.25 am, has been on for several hours. The local police was quoted as saying that three gunmen opened fire on the consulate from a nearby house with machine guns and rocket-propelled grenades. One of them was shot dead while he was trying to scale the wall of the consulate.The two other attackers were reportedly surrounded by over 150 security personnel, including soldiers of the Indo-Tibetan Border Police (ITBP).Indian Foreign Ministry spokesperson Syed Akbaruddin told NDTV, "Earlier this morning the consulate was attacked. Our brave ITBP personnel and Afghan soldiers were successful in rebutting the attack. All Indian personnel are safe."He added that Afghanistan officials were in touch with India and senior officials including Foreign Secretary Sujatha Singh were monitoring the situation.The choice of Herat for the attack has surprised many as the city, which lies near Afghanistan's border with Iran, is considered one of the safest in the country.The attack comes on a day Islamabad is expected to inform India whether Pakistan Prime Minister Nawaz Sharif will come for Narendra Modi 's swearing in as Prime Minister on Monday. (Nawaz Sharif at Modi's Swearing In? Pakistan's RSVP Today)

Afghan president Hamid Karzai has confirmed that he will attend the oath ceremony.India has invested more than $2 billion in Afghan projects, including roads and power projects.