[Q]: There was a discussion that took place between some brothers and myself regarding praying two rak’ahs upon entering the mosque and the Imaam is delivering the Friday khutbah (sermon). I ask you – O noble Shaykh – to give us a ruling concerning this. Is it allowed or not? The brothers who generally come and pray in the mosque are upon the madhhab of Imaam Maalik.
[A]: “The Sunnah upon entering the masjid (mosque) is to pray two rak’ahs of tahyatul masjid (a Prayer far greeting the mosque), even if the Imaam is delivering the Friday khutbah, due to the sayings of the Prophet sallallaahu ‘alayhi wa sallam:
“When anyone of you enters the masjid, then let him not sit until he prays two rak’ahs.” Recorded by al-Bukhaaree (1/293) and Muslim (2/155).
Likewise Muslim relates in his Saheeh (3/1415), from Jaabir radiallaahu ‘anhu, that the Prophet sallallaahu ‘alayhi wa sallam said:
“When any of you comes on the day of Jumu’ah (Friday), and the Imaam is delivering the khutbah, then let him pray two rak’ahs and let him make them short.”
So this is a clear and authentic text concerning this issue. It is not permissible for anyone to oppose it. So perhaps this particular narration did not reach Imaam Maalik rahimahullaah, if it is established from him that he prohibited the praying of these two rak’ahs at the time of the khutbah. However, when the authentic Sunnah becomes clear, then it is not permissible to oppose it with the saying of anyone else – whosoever he may be. 
About this Allaah – the Mighty and Majestic – said:
“O you who Believe! Obey Allaah and obey the Messenger and those in authority amongst you. And if you differ in anything amongst yourselves then refer it to Allaah and His Messenger if you do believe in Allaah and the Last Day. That is better and most suitable for final determination.” [Soorah an-Nisaa 4:59].
And He – the Most Perfect – said:
“And in whatever you differ, then the judgement belongs to Allaah,” [Soorah ash-Shooraa 42:10].
And it is known that the judgement of Allaah’s Messenger sallallaahu ‘alayhi wa sallam is from the judgement of Allaah – the Mighty and Majestic – as Allaah said:
“Whosoever obeys the Messenger, has indeed obeyed Allaah.”[Soorah an-Nisaa 4:80].
And with Allaah rests the power and ability.”
 Imaam an-Nawawee – rahimahullaah – said about the hadeeth in Sharh Saheeh Muslim (6/ 164): “I cannot imagine any Scholar who comes to knows about it and believes in the correctness of it, and would then oppose it.”
Al-Istiqaamah Issue No.7 – Rabî’ ul-Awwal 1418H / July 1997