"Incidents such as this only deepen our conviction that terrorism remains the main threat to peace and security in Afghanistan," Modi said in his letter.
Hashmat Karzai was assassinated by a suicide bomber in Kandahar on Tuesday. Modi said such incidents demonstrate that brave Afghans who oppose the menace of terrorism and its use as an instrument of state policy are being targeted systematically, a PMO statement said.
"I know that you will remain a steadfast bulwark in the face of these challenges and continue to work to deliver a better future to Afghanistan," the Prime Minister wrote to Karzai, adding that India would remain a "constant partner" in this endeavour.
Modi also sent his condolences to the family of the deceased.