The Messenger of Allah ﷺ set out to perform Umrah, but the disbelievers of Quraysh blocked him from reaching the House. So he sacrificed his offering and shaved his head at Hudaybiyah. He concluded a peace agreement with them on the condition that he would perform Umrah the following year, would not carry weapons against them (Siraj's version says, "would not carry any weapons except swords"), and would not stay in Mecca beyond what they permitted.The following year he performed Umrah and entered Mecca according to the terms he had agreed upon with them. When he had stayed three days, they ordered him to leave, and he departed.
حدثنا يونس وسريج قالا حدثنا فليح عن نافع
أن رسول الله ﷺ خرج معتمرا فحال كفار قريش بينه وبين البيت فنحر هديه وحلق رأسه بالحديبية فصالحهم على أن يعتمروا العام المقبل ولا يحمل السلاح عليهم وقال سريج ولا يحمل سلاحا إلا سيوفا ولا يقيم بها إلا ما أحبوا فاعتمر من العام المقبل فدخلها كما كان صالحهم فلما أن أقام ثلاثا أمروه أن يخرج فخرج