(Imām Bukhārī narrates): Ya'qub bin Ibrahim narrated the hadith to us, he said: Ibn Ulayyah narrated the hadith to us, he said: Ayyub informed us, from Nafi', he narrates that
Hazrat Ibn Umar (Allāh be pleased with them both) used to offer the prayer of Chasht only on two days: the day he came to Makkah, because he used to come to Makkah at the time of Chasht, so he would perform tawaf of the Baitullah, then he would offer two rak'ahs of prayer behind Maqam Ibrahim; and the day he came to Masjid Quba, and he used to come to Masjid Quba every Saturday, so when he entered the mosque, he disliked leaving the mosque without offering prayer, and Hazrat Ibn Umar used to narrate this hadith, that the Messenger of Allāh ﷺ used to visit Masjid Quba, upon a mount and on foot.
حَدَّثَنَا يَعْقُوبُ بْنُ إِبْرَاهِيمَ ـ هُوَ الدَّوْرَقِيُّ ـ حَدَّثَنَا ابْنُ عُلَيَّةَ، أَخْبَرَنَا أَيُّوبُ، عَنْ نَافِعٍ، أَنَّ ابْنَ عُمَرَ ـ رضى الله عنهما ـ كَانَ لاَ يُصَلِّي مِنَ الضُّحَى إِلاَّ فِي يَوْمَيْنِ يَوْمَ يَقْدَمُ بِمَكَّةَ، فَإِنَّهُ كَانَ يَقْدَمُهَا ضُحًى، فَيَطُوفُ بِالْبَيْتِ، ثُمَّ يُصَلِّي رَكْعَتَيْنِ خَلْفَ الْمَقَامِ، وَيَوْمَ يَأْتِي مَسْجِدَ قُبَاءٍ، فَإِنَّهُ كَانَ يَأْتِيهِ كُلَّ سَبْتٍ، فَإِذَا دَخَلَ الْمَسْجِدَ كَرِهَ أَنْ يَخْرُجَ مِنْهُ حَتَّى يُصَلِّيَ فِيهِ. قَالَ وَكَانَ يُحَدِّثُ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم كَانَ يَزُورُهُ رَاكِبًا وَمَاشِيًا. قَالَ وَكَانَ يَقُولُ إِنَّمَا أَصْنَعُ كَمَا رَأَيْتُ أَصْحَابِي يَصْنَعُونَ، وَلاَ أَمْنَعُ أَحَدًا أَنْ يُصَلِّيَ فِي أَىِّ سَاعَةٍ شَاءَ مِنْ لَيْلٍ أَوْ نَهَارٍ، غَيْرَ أَنْ لاَ تَتَحَرَّوْا طُلُوعَ الشَّمْسِ وَلاَ غُرُوبَهَا.
Reference: Sahih Al Bukhari 1191