Jami` at-Tirmidhi, Book 47, Hadith 3225 (In-Book) ⓘ
Narrated Al-Bara bin 'Azib: "When the Messenger of Allah arrived in Al-Madinah, he performed Salat facing the direction of Bait Al-Maqdis (Jerusalem) for sixteen or seventeen months. The Messenger of Allah longed to face toward the Ka'bah, so Allah, Might and Sublime is He revealed: Verily, WE have seen the turning of your face towards the heave. Surely, We Shall turn your face in the direction of Al-Masjid Al-Haram (2:144). So he faced the direction of the Ka'bah and he longed for that. (One day) a man performed Salat Al-'Asr along with him." He said: "Then he passed by some people of the Ansar performing Salat Al-'Asr, while they were bowing toward Bait Al-Maqdis. He told them that he testifies that he performed Salat with the Messenger of Allah, and he had faced the direction of the Ka'bah." He said: "So they turned while they were bowing."
حَدَّثَنَا هَنَّادٌ، حَدَّثَنَا وَكِيعٌ، عَنْ إِسْرَائِيلَ، عَنْ أَبِي إِسْحَاقَ، عَنِ الْبَرَاءِ بْنِ عَازِبٍ، قَالَ لَمَّا قَدِمَ رَسُولُ اللَّهِ صلى الله عليه وسلم الْمَدِينَةَ صَلَّى نَحْوَ بَيْتِ الْمَقْدِسِ سِتَّةَ أَوْ سَبْعَةَ عَشَرَ شَهْرًا وَكَانَ رَسُولُ اللَّهِ صلى الله عليه وسلم يُحِبُّ أَنْ يُوَجَّهَ إِلَى الْكَعْبَةِ فَأَنْزَلَ اللَّهُ: ( قَدْ نَرَى تَقَلُّبَ وَجْهِكَ فِي السَّمَاءِ فَلَنُوَلِّيَنَّكَ قِبْلَةً تَرْضَاهَا فَوَلِّ وَجْهَكَ شَطْرَ الْمَسْجِدِ الْحَرَامِ ) فَوَجَّهَ نَحْوَ الْكَعْبَةِ وَكَانَ يُحِبُّ ذَلِكَ فَصَلَّى رَجُلٌ مَعَهُ الْعَصْرَ قَالَ ثُمَّ مَرَّ عَلَى قَوْمٍ مِنَ الأَنْصَارِ وَهُمْ رُكُوعٌ فِي صَلاَةِ الْعَصْرِ نَحْوَ بَيْتِ الْمَقْدِسِ فَقَالَ هُوَ يَشْهَدُ أَنَّهُ صَلَّى مَعَ رَسُولِ اللَّهِ صلى الله عليه وسلم وَأَنَّهُ قَدْ وُجِّهَ إِلَى الْكَعْبَةِ قَالَ فَانْحَرَفُوا وَهُمْ رُكُوعٌ . قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ صَحِيحٌ وَقَدْ رَوَاهُ سُفْيَانُ الثَّوْرِيُّ عَنْ أَبِي إِسْحَاقَ .
also referenced under: Hadith 2962 (Reference) & Volume 5, Book 44, Hadith 2962 (DarusSalam)