Karzai also told Modi that a thorough investigation has been launched into the attack.
Modi also spoke to India's Ambassador in Afghanistan Amar Sinha soon after the attack and lauded the role of security forces manning the consulate for their valiant efforts in fighting and killing the terrorists who attacked it.
"President Karzai & I talked about consulate attack in Herat. He assured me he will do everything to protect India's Missions in Afghanistan," Modi tweeted.
"I condemn the attack on our consulate in Herat, Afghanistan. Closely monitoring the situation. I have spoken to the Ambassador as well," Modi said.
"India salutes the efforts of India's security personnel & Afghan security forces for their valiant efforts to fight the terrorists in Herat," he tweeted, adding "I salute the consulate staff for their indomitable spirit & high morale throughout the difficult circumstances."
A statement by the Afghan President's office said Karzai telephoned Modi and "strongly condemned today's terrorist attack on the Indian consulate", calling it "an attack on Afghanistan, India and our shared interests.
