Language:
كتاب الصلح
53  
Peacemaking
(7)
Chapter: To make peace with Al-Mushrikun
(7)
باب الصُّلْحِ مَعَ الْمُشْرِكِينَ
Sahih al-Bukhari 2701

Narrated Ibn `Umar:

Allah's Messenger (ﷺ) set out for the `Umra but the pagans of Quraish prevented him from reaching the Ka`ba. So, he slaughtered his sacrifice and got his head shaved at Al-Hudaibiya, and agreed with them that he would perform `Umra the following year and would not carry weapons except swords and would not stay in Mecca except for the period they allowed. So, the Prophet (ﷺ) performed the `Umra in the following year and entered Mecca according to the treaty, and when he stayed for three days, the pagans ordered him to depart, and he departed.

حَدَّثَنَا مُحَمَّدُ بْنُ رَافِعٍ، حَدَّثَنَا سُرَيْجُ بْنُ النُّعْمَانِ، حَدَّثَنَا فُلَيْحٌ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، رضى الله عنهما أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم خَرَجَ مُعْتَمِرًا، فَحَالَ كُفَّارُ قُرَيْشٍ بَيْنَهُ وَبَيْنَ الْبَيْتِ، فَنَحَرَ هَدْيَهُ، وَحَلَقَ رَأْسَهُ بِالْحُدَيْبِيَةِ، وَقَاضَاهُمْ عَلَى أَنْ يَعْتَمِرَ الْعَامَ الْمُقْبِلَ، وَلاَ يَحْمِلَ سِلاَحًا عَلَيْهِمْ إِلاَّ سُيُوفًا، وَلاَ يُقِيمَ بِهَا إِلاَّ مَا أَحَبُّوا، فَاعْتَمَرَ مِنَ الْعَامِ الْمُقْبِلِ فَدَخَلَهَا كَمَا كَانَ صَالَحَهُمْ، فَلَمَّا أَقَامَ بِهَا ثَلاَثًا أَمَرُوهُ أَنْ يَخْرُجَ فَخَرَجَ‏.‏
Reference : Sahih al-Bukhari 2701
In-book reference : Book 53, Hadith 11
USC-MSA web (English) reference : Vol. 3, Book 49, Hadith 864
  (deprecated numbering scheme)