Modi also spoke to India's Ambassador in Afghanistan Amar Sinha soon after the attack, condemned it and said that he was closely monitoring the situation.
He also lauded the role of security forces manning the Consulate in Herat 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.
"India salutes the efforts of India's security personnel & Afghan security forces for their valiant efforts to fight the terrorists in Herat."
Modi also praised the "indominable spirit" of the consulate staff in Herat for maintaining a high morale.
"I salute the Consulate staff for their indomitable spirit & high morale throughout the difficult circumstances," he said.
"I condemn the attack on our consulate in Herat, Afghanistan. Closely monitoring the situation. I have spoken to the Ambassador as well," he said.
Indian Ambassador to Afghanistan Amar Sinha said there were nine Indians in the mission apart from local Afghans.
