The Quraish sent Suhail b Amr as their emissary. After considerable discussion an agreement was arrived at, and this came to be known as the Hudaibiyah pact. According to the pact there was to be truce between the Quraish and the Muslims for a period of ten years. Each party was free to make its own alliances, but they were not to resort to war. Any person who deserted the Muslims and sought refuge with the Quraish was not to be returned, but any person who escaped from the Quraish to the Muslims was to be returned to the Quraish. It was stipulated that the Muslims were to return to Madina that year without performing the pilgrimage, but they could come to Makkah the following year for performing the pilgrimage when the Quraish would vacate the city for them for three days.
After the pact had been signed, the Muslims sacrificed the animals they had brought with them; broke the camp and started on the return journey to Madina.