Shafi breathed his last at 6:20pm at Asgar Ali Hospital at Gandaria in the old part of Dhaka.
Earlier, he was shifted to Dhaka from Chattogram Medical College Hospital by an air-ambulance this afternoon as his condition deteriorated.
Shafi’s son Anas Madani confirmed the matter, saying his father died at the Asgar Ali Hospital in Gendaria around 6:40 pm in the evening.
Meanwhile, Prime Minister Sheikh Hasina expressed her deep shock and sorrow at the death of Amir of Hefazat-e-Islam Bangladesh Allama Shah Ahmad Shafi.
In a condolence message, the prime minister prayed for eternal peace of the departed soul and conveyed profound sympathy to the bereaved family.
Earlier Shafi, also the chief of Hefajat-e-Islam, resigned from his madrasa post after a meeting of Majlis-e-Shura (policymaking body) on Thursday night, citing health grounds.
He was admitted to Chattogram Medical College Hospital and later shifted to a hospital in the capital.
Shah Ahmad Shafi was rector of Al-Jamiatul Ahlia Darul Unum Moinul Islam Hathazari, to give the institution its full name, and also the chairman of Bangladesh Qawmi Madrasah Education Board.
He was born in 1916 (1334-35 AH) in Rangunia of Chattogram and was educated at Hathazari Madrasah and Darul Uloom Deoband.
Shafi commenced his career as a teacher at AL-Jamiatul Ahlia Darul Ulum Moinul Islam Hathazari madrasa in Chittagong.