Abdullah bin Umar reported,

The Messenger of Allah ﷺ set out to perform Umrah, but the disbelievers of Quraysh blocked him from reaching the Sacred House. So he sacrificed his offering and shaved his head at Hudaybiyah, and made a treaty with them that he would perform Umrah the following year, that he would not carry weapons against them except swords, and that he would not stay in Mecca longer than they wished.The following year he performed Umrah and entered Mecca according to the terms he had settled with them. After he had stayed there for three days, they ordered him to leave, and he departed.

Azami 9008

Sahih

عن ابن عمر

أن رسول الله ﷺ خرج معتمرا، فحال كفار قريش بينه وبين البيت، فنحر هديه وحلق رأسه بالحديبية، وقاضاهم على أن يعتمر العام المقبل، ولا يحمل سلاحا عليهم إلا سيوفا، ولا يقيم بها إلا ما أحبوا، فاعتمر من العام المقبل، فدخلها كما كان صالحهم، فلما أقام بها ثلاثا، أمروه أن يخرج فخرج.

الأعظمي 9008صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Biography of the Prophet ﷺ
Chapter
Expedition of Hudaybiya and expedition of Dhat al-Qarad
Section
Peace agreement between the Prophet ﷺ and Suhayl bin Amr on the day of Hudaybiya, and mention of the events that occurred after the peace agreement
Numbering
Jami al-Kamil 9008 (2nd edition)
Azami 9008