to those mosques, even though the visitor’s stated purpose is none other than the worship of Allah alone. That is because this practice becomes a conduit that may lead him to visit the mosque on account of the person in the grave—calling upon him, appealing through him, or supplicating at his graveside. For that reason the Messenger of Allah ﷺ forbade designating such a place exclusively for the worship of Allah, lest it serve as a pretext leading to what is prohibited—just as he forbade praying during the three time-periods because of the overriding harm involved, namely imitating the idolaters, an imitation that leads to polytheism, even though the worshiper himself intends nothing beyond performing the prayer at those times.
Because of this, the scholars disagreed about prayers that have specific causes; many of them allowed such prayers during those periods, and that is the sounder of the two scholarly views. When a prohibition is instituted merely to block a means (sadd al-dharīʿa), it may be set aside for a weightier benefit. Prayers that have particular causes are needed precisely at those moments, and if they are not performed then, their benefit is lost; therefore they are permitted because of the preponderant benefit they bring. This differs from prayers with no specific cause: they can easily be performed outside the forbidden times, so no significant benefit is forfeited by the ban, while the harm that warrants the prohibition remains.
Since his prohibition of prayer at those times was to block the road to idolatry—lest it culminate in prostration to the sun and invoking it, as is done by the devotees of the sun, the moon, and the stars who beseech them—it is clear that calling upon the sun and prostrating to it are inherently forbidden and far more severely prohibited than the prayer he banned only to prevent people from eventually supplicating the heavenly bodies.
Likewise, when he forbade turning the graves of prophets and the righteous into mosques and prohibited going to them to pray beside them, lest this lead to invoking them and prostrating to them, it follows that calling upon them and prostrating to them—