Knocking down the old Masjid to build a public library

Q: According to Shari`ah (Islamic law), is it permissible to raze an old Masjid (mosque) (Part No. 16; Page No. 40) in order to build a public library in its place? If this is not allowed, is it permissible to take compensation for the land or is the matter left to those who are responsible for the Masjid to accept another Masjid in another place instead?

A: It is not permissible to knock down a Masjid even if it is old just to build a public library in its place. Furthermore, it is not permissible to build a public library in its place, even if it is ruined. Your duty is to restore it if it is old and build another one if it is ruined, even if you have to sell parts of it to repair the rest. The basic ruling on Waqf (endowment) is that it is not to be sold, granted or bequeathed. The Prophet (peace be upon him) said to `Umar ibn Al-Khattab (may Allah be pleased with him) when he wanted to give his yielding land in Khaybar in charity "Give it in charity (i.e. as an endowment with its land and trees) on the condition that it will neither be sold, given as a present, nor bequeathed, but the fruits are to be given in charity." This is a general ruling related to any Waqf. Muslim scholars exclude the Waqf that no longer serves (Part No. 16; Page No. 41) its purpose or whose movement to another place makes it more beneficial. In this case, it is permissible to sell it or exchange it for another which serves the same purpose, so as to ensure that it provides its benefits or to enhance them. It is related that `Umar ibn Al-Khattab wrote to Sa`d ibn Abu Waqqas (may Allah be pleased with them both) when he was informed of the theft that happened in Bayt-ul-Mal (Muslim treasury) located in Al-Kufah. He ordered him to move the Masjid from the area of Al-Tammarin and have Bayt-ul-Mal in its Qiblah (Ka`bah-direction faced in Prayer) and there will still be place for prayer. This decision was made in the presence of the Sahabah (Companions of the Prophet) and no one disagreed, which makes it unanimous. This solution kept the Waqf in its core meaning if not in application. However, you should bear in mind that if the selling or exchange is permissible, it should be carried out by the ruler or his deputy as a precautionary measure in order to preserve the Waqf from any manipulation. May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.