كتاب المغازى
64  
Military Expeditions led by the Prophet (pbuh) (Al-Maghaazi)
(48)
Chapter: Where did the Prophet (saws) fix the flag on the day of the conquest of Makkah?
(48)
باب أَيْنَ رَكَزَ النَّبِيُّ صلى الله عليه وسلم الرَّايَةَ يَوْمَ الْفَتْحِ
Sahih al-Bukhari 4288

Narrated Ibn `Abbas:

When Allah's Messenger (ﷺ) arrived in Mecca, he refused to enter the Ka`ba while there were idols in it. So he ordered that they be taken out. The pictures of the (Prophets) Abraham and Ishmael, holding arrows of divination in their hands, were carried out. The Prophet (ﷺ) said, "May Allah ruin them (i.e. the infidels) for they knew very well that they (i.e. Abraham and Ishmael) never drew lots by these (divination arrows). Then the Prophet (ﷺ) entered the Ka`ba and said. "Allahu Akbar" in all its directions and came out and not offer any prayer therein.

حَدَّثَنِي إِسْحَاقُ، حَدَّثَنَا عَبْدُ الصَّمَدِ، قَالَ حَدَّثَنِي أَبِي، حَدَّثَنَا أَيُّوبُ، عَنْ عِكْرِمَةَ، عَنِ ابْنِ عَبَّاسٍ ـ رضى الله عنهما ـ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم لَمَّا قَدِمَ مَكَّةَ أَبَى أَنْ يَدْخُلَ الْبَيْتَ وَفِيهِ الآلِهَةُ، فَأَمَرَ بِهَا فَأُخْرِجَتْ، فَأُخْرِجَ صُورَةُ إِبْرَاهِيمَ، وَإِسْمَاعِيلَ فِي أَيْدِيهِمَا مِنَ الأَزْلاَمِ، فَقَالَ النَّبِيُّ صلى الله عليه وسلم ‏ "‏ قَاتَلَهُمُ اللَّهُ لَقَدْ عَلِمُوا مَا اسْتَقْسَمَا بِهَا قَطُّ ‏"‏‏.‏ ثُمَّ دَخَلَ الْبَيْتَ، فَكَبَّرَ فِي نَوَاحِي الْبَيْتِ، وَخَرَجَ وَلَمْ يُصَلِّ فِيهِ‏.‏ تَابَعَهُ مَعْمَرٌ عَنْ أَيُّوبَ‏.‏ وَقَالَ وُهَيْبٌ حَدَّثَنَا أَيُّوبُ عَنْ عِكْرِمَةَ عَنِ النَّبِيِّ صلى الله عليه وسلم‏.‏
Reference : Sahih al-Bukhari 4288
In-book reference : Book 64, Hadith 321
USC-MSA web (English) reference : Vol. 5, Book 59, Hadith 584
  (deprecated numbering scheme)