In the sixth year of the Hijrah, the Prophet Muhammad left Madinah for Makkah along with his companions, so that he could perform the rite of pilgrimage there. He had reached Hudaybiyyah when the pagans of Makkah came forward and barred his way, saying that they would not allow him to enter Makkah. Mutual negotiations followed, as a result of which a peace treaty was drawn up and signed by both sides.