Sayyiduna Ibn Abbas (may Allah be pleased with them both) narrates that the people were commanded (by the Messenger of Allah, peace and blessings be upon him) that their last act in Makkah Mukarramah should be the circumambulation (Tawaf) of the House of Allah (Baytullah).
Hadith Referenceصحيح ابن خزيمه / جماع أبواب ذكر أفعال اختلف الناس فى إباحته للمحرم، نصت سنة النبى صلى الله عليه وسلم أو دلت على إباحتها / 2999
Sayyiduna Ibn Abbas (may Allah be pleased with them both) narrates that when the people would depart from all sides, the Messenger of Allah (peace be upon him) ordered that none of you should return without performing the last (farewell) Tawaf.
Hadith Referenceصحيح ابن خزيمه / جماع أبواب ذكر أفعال اختلف الناس فى إباحته للمحرم، نصت سنة النبى صلى الله عليه وسلم أو دلت على إباحتها / 3000