Question
Can endowed (waqf) property belonging to a specific mosque or madrasa be used elsewhere for another religious purpose, when it is left over from that mosque or madrasa and is not needed there?
Answer
There is a hadith in Abu Dawud that a man dedicated his camel in the way of Allah, his intention being jihad. After that he needed it for Hajj, so the Messenger of Allah ﷺ permitted him and said: this too is in the way of Allah. From this it is understood that there is no harm in spending something belonging to one mosque or madrasa in another mosque or madrasa when it is surplus, because “all of this is in the way of Allah.”