In ths month of Shaban in the same year (the second year of Hijra), Allah (Glory be to Him) ordered that the direction of Prayer should be changed from Al-Aqsa mosque in Jerusalem to the sacred mosque in Mecca. The Messenger (peace be upon him) used to pray towards the Al-Aqsa mosque when he was living in Mecca, and the Kabaa used to be in front of him at that time, but when he immigrated to Medinah, he could not pray facing the two holy mosques at the same time. Therefore, the Messenger (peace be upon him) prayed towards Al-Aqsa mosque for the first 16 or 17 months he was in Medinah, up until the month of Rajab in the second year of Hijra [The Prophet’s Biography by Ibn Hesham]. Ibn Is-haq said, “The Prayer direction changed in the month of Shaban, exactly 18 months after the Messenger (peace be upon him) moved to Medinah” [The Beginning and the End].
The noble Companion Ibn Abdullah ibn Omar (may Allah be pleased with him) told us about this change of the Prayer direction, saying, “When the people were praying Fajr (Dawn) Prayer in Quba mosque, someone came, saying, ‘Allah revealed to the Messenger (peace be upon him) a verse with an order to face it (the Kabaa)’; therefore, we moved to face the Kabaa” [related by Al-Bukhari].
Anas related, “The Messenger (peace be upon him) used to pray towards Al-Aqsa mosque, and then Allah (Glory be to Him) revealed the ayah (verse of Quran), {We see you often turning your face towards the sky; now We are turning you to the direction that will satisfy you. Turn your face towards the Holy Mosque} [Surah Al-Baqarah: 144]. A man from Banu Salimah passed when some Muslims were bowing in Fajr (Dawn) Prayer. They had prayed one rakat of the Prayer. The man called out, ‘The Prayer direction has changed,’ so they moved, as they were (in the bowing position), to face the Prayer direction (of the Kabaa)” [related by Muslim].
We can notice from this story of the change of the Prayer direction to what great extent the Messenger (peace be upon him) and his noble Companions complied with the order of Allah; the Messenger (peace be upon him) did not change the Prayer direction to Mecca, although he eagerly wished to do so, until after Allah (Glory be to Him) gave him the permission to do change it. This was also the case for the noble Companions. Moreover, the news of the change in the Prayer direction reached them when they were actually in the Prayer, and they immediately and obediently moved their faces and hearts towards the sacred mosque in Mecca, carrying out Allah’s order, {It does not behove a believer, male or female, when Allah and His Messenger have decided an affair, that they should exercise their choice} [Surah Al-Ahzab: 36].