"When Allah's Messener arrived in Al-Madinah, he faced Bait Al-Maqdis in Salat for sixteen or seventeen months. Messenger of Allah longed to face the direction of the Ka'bah, so Allah Most High revealed: Verily! We have seen the turning of your face towards the heaven. Surely We shall turn you o a Qiblah that shall please you. So turn your face in the direction of Al-Masjid Al-Haram.So he faced the Ka'bah, and he liked that. A man performed the Asr prayer with him, then passed by some of the Ansar who were bowing in Salat for Asr while facing Bait Al-Maqdis." He told them that he had faced the direction of the Ka'bah, so they changed (their direction) while they were bowing." [He said:] There are narrations on this topic from Ibn Umar, Ibn Abbas, Umarah bin Aws, Amr bin Awf Al-Muzani and Anas. (Using translation from Tirmidhī 340)
صَلَّى رَسُولُ اللهِ ﷺ نَحْوَ بَيْتِ الْمَقْدِسِ سِتَّةَ عَشَرَ شَهْرًا أَوْ سَبْعَةَ عَشَرَ شَهْرًا ثُمَّ وُجِّهَ إِلَى الْكَعْبَةِ وَكَانَ يُحِبُّ ذَلِكَ فَأَنْزَلَ اللهُ ﷻ {قَدْ نَرَى تَقَلُّبَ وَجْهِكَ فِي السَّمَاءِ فَلَنُوَلِّيَنَّكَ قِبْلَةً تَرْضَاهَا فَوَلِّ وَجْهَكَ شَطْرَ الْمَسْجِدِ الْحَرَامِ} [البقرة 144] الْآيَةَ قَالَ فَمَرَّ رَجُلٌ صَلَّى مَعَ النَّبِيِّ ﷺ الْعَصْرَ عَلَى قَوْمٍ مِنَ الْأَنْصَارِ وَهُمْ رُكُوعٌ فِي صَلَاةِ الْعَصْرِ نَحْوَ بَيْتِ الْمَقْدِسِ فَقَالَ هُوَ يَشْهَدُ أَنَّهُ صَلَّى مَعَ رَسُولِ اللهِ ﷺ وَأَنَّهُ قَدْ وُجِّهَ إِلَى الْكَعْبَةِ قَالَ فَانْحَرَفُوا وَهُمْ رُكُوعٌ فِي صَلَاةِ الْعَصْرِ