In his message, Ansari said he was deeply saddened to learn of the untimely passing away of Marshal Fahim who, he said, was a fearless commander and one of the bravest sons of Afghanistan.
He said Marshal Fahim was a friend of his who devoted his entire life to combating the dark forces of extremism and terrorism that continue to threaten Afghanistan and its people.
"The people of India shall always remember Marshal Fahim for his tireless efforts to strengthen the India-Afghanistan strategic partnership," he said.
"Today our prayers and thoughts are with the bereaved family and the friendly people of Afghanistan. May the Almighty give them strength and courage to bear their loss," he added.
Dr Singh in his condolence message recalled Marshal Fahim's contribution to promoting the strategic partnership between India and Afghanistan.
"It is with great sadness that I learnt of the passing away of the First Vice President of Afghanistan, Marshal Fahim. He was a brave and fearless military commander, whose contribution to Afghanistan's stabilisation and reconstruction after over three decades of war and conflict will always be remembered," he said.
"Marshal Fahim was also a close friend of India. We shall never forget his personal contribution to nurturing and strengthening the India Afghanistan strategic partnership. We pray to the almighty to give the family of Marshal Fahim the strength and fortitude to bear their loss at this time of great sorrow," he added.