Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
ahmad:2991Yaḥyá b. Ḥammād > Abū ʿAwānah > al-Aʿmash > Mujāhid > Ibn ʿAbbās

[Machine] The Prophet ﷺ used to pray while he was in Mecca, facing the direction of Al-Masjid Al-Aqsa, with the Kaaba in front of him. After migrating to Medina, he continued praying towards Al-Masjid Al-Aqsa for sixteen months before the direction of prayer was changed towards the Kaaba.  

أحمد:٢٩٩١حَدَّثَنَا يَحْيَى بْنُ حَمَّادٍ حَدَّثَنَا أَبُو عَوَانَةَ عَنِ الْأَعْمَشِ عَنْ مُجَاهِدٍ عَنِ ابْنِ عَبَّاسٍ قَالَ

كَانَ رَسُولُ اللهِ ﷺ يُصَلِّي وَهُوَ بِمَكَّةَ نَحْوَ بَيْتِ الْمَقْدِسِ وَالْكَعْبَةُ بَيْنَ يَدَيْهِ وَبَعْدَ مَا هَاجَرَ إِلَى الْمَدِينَةِ سِتَّةَ عَشَرَ شَهْرًا ثُمَّ صُرِفَ إِلَى الْكَعْبَةِ  


See similar narrations below:

Collected by Ṭabarānī, Bayhaqī
tabarani:11066Muḥammad b. ʿBdws b. Kāmil > Muḥammad b. ʿAbdullāh b. Numayr > Yaḥyá b. Ḥammād > Abū ʿAwānah > al-Aʿmash > Mujāhid > Ibn ʿAbbās

[Machine] The Prophet ﷺ used to pray while he was in Mecca, facing the direction of the Sacred House (Jerusalem) and the Kaaba was in front of him. After migrating for sixteen months, he then turned towards the Kaaba.  

الطبراني:١١٠٦٦حَدَّثَنَا مُحَمَّدُ بْنُ عبدوسِ بْنِ كَامِلٍ ثنا مُحَمَّدُ بْنُ عَبْدِ اللهِ بْنِ نُمَيْرٍ ثنا يَحْيَى بْنُ حَمَّادٍ ثنا أَبُو عَوَانَةَ عَنِ الْأَعْمَشِ عَنْ مُجَاهِدٍ عَنِ ابْنِ عَبَّاسٍ قَالَ

«كَانَ النَّبِيُّ ﷺ يُصَلِّي وَهُوَ بِمَكَّةَ نَحْوَ بَيْتِ الْمَقْدِسِ وَالْكَعْبَةُ بَيْنَ يَدَيْهِ وَبَعْدَمَا هَاجَرَ سِتَّةَ عَشَرَ شَهْرًا ثُمَّ انْصَرَفَ إِلَى الْكَعْبَةِ»  

bayhaqi:2193Abū ʿAbdullāh al-Ḥāfiẓ And ʾAbū Saʿīd b. Abū ʿAmr > Abū al-ʿAbbās Muḥammad b. Yaʿqūb > Ibrāhīm b. Marzūq > Yaḥyá b. Ḥammād > Abū ʿAwānah > Sulaymān > Mujāhid > Ibn ʿAbbās

[Machine] The Prophet ﷺ used to pray towards the direction of Masjid al-Aqsa and the Kaaba, with both of them in front of him. After moving to Medina, he continued to pray in this direction for sixteen months, then Allah Almighty changed the direction towards the Kaaba.  

البيهقي:٢١٩٣أَخْبَرَنَا أَبُو عَبْدِ اللهِ الْحَافِظُ وَأَبُو سَعِيدِ بْنُ أَبِي عَمْرٍو قَالَا ثنا أَبُو الْعَبَّاسِ مُحَمَّدُ بْنُ يَعْقُوبَ ثنا إِبْرَاهِيمُ بْنُ مَرْزُوقٍ ثنا يَحْيَى بْنُ حَمَّادٍ ثنا أَبُو عَوَانَةَ عَنْ سُلَيْمَانَ عَنْ مُجَاهِدٍ عَنِ ابْنِ عَبَّاسٍ

أَنَّ النَّبِيَّ ﷺ كَانَ يُصَلِّي نَحْوَ بَيْتِ الْمَقْدِسِ وَالْكَعْبَةُ بَيْنَ يَدَيْهِ وَبَعْدَ مَا تَحَوَّلَ إِلَى الْمَدِينَةِ سِتَّةَ عَشَرَ شَهْرًا ثُمَّ صَرَفَهُ اللهُ تَعَالَى إِلَى الْكَعْبَةِ