Sayyiduna al-Bara' (may Allah be pleased with him) says: The Messenger of Allah (peace and blessings be upon him) stayed in Makkah for three days during Umrat al-Qada'. When it was the third day, the people of Makkah said to Sayyiduna Ali (may Allah be pleased with him): Today is the last day of the agreement, so tell your companion to leave. Sayyiduna Ali (may Allah be pleased with him) informed him (peace and blessings be upon him), and he (peace and blessings be upon him) said: "Yes." And then he left Makkah.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب النفقات / 15769