in his Ṣaḥīḥ (2/76) from the report of Abū Dharr: “He entered the mosque, and the Prophet ﷺ said to him, ‘Have you prayed two rak‘ahs?’ He replied, ‘No.’ The Prophet said, ‘Then stand up and pray them.’”
-
Shaykh ʿUthmān ibn Qāʾid al-Najdī stated: “Circumambulation (ṭawāf) is the greeting of the Kaʿbah, whereas the greeting of the Sacred Mosque is prayer, and the two rak‘ahs performed after ṭawāf fulfil that greeting.” This does not contradict the view that the greeting of al-Masjid al-Ḥarām itself is ṭawāf, for one statement is general while the other is specific, as explained in al-Iqnāʿ.
In Subul al-Salām it is said: “If someone enters the Sacred Mosque and wishes to sit before performing ṭawāf, or does not intend to make ṭawāf at all, he is still prescribed to offer the greeting just as in any other mosque.” -
If a person enters the mosque while the obligatory congregational prayer is already under way and he intends to join it, he must join immediately; it is impermissible for him to busy himself with any other prayer. Muslim narrates (710): “When the prescribed prayer has been established, there is no prayer except the obligatory one.” Joining that congregation suffices for the Greeting of the Mosque, for when two acts of worship of the same kind coincide, one subsumes the other.
Disagreement among the scholars
The jurists differ over prayers that have an underlying cause—such as the Greeting of the Mosque, the two rak‘ahs after wuḍūʾ, and the eclipse prayer—whether they may be performed during the forbidden times for voluntary prayer.
• The Ḥanafīs, Mālikīs, and Ḥanbalīs hold that no supererogatory prayer may be offered during the prohibited times, with the sole exception of the two rak‘ahs after ṭawāf; and according to the Ḥanafīs even these two should not be prayed then, arguing from the general ḥadiths of prohibition.
• The Shāfiʿīs—and one of the two opinions within the Ḥanbalī school—maintain that the prohibition applies only to unrestricted voluntary prayers that lack a specific cause, whereas prayers that have a reason are permissible whenever that reason arises.