It is narrated from Sayyiduna Anas bin Malik (may Allah be pleased with him) that he said: "Whenever the Messenger of Allah (peace and blessings be upon him) halted at a place, he would not depart from there until he had bid farewell to that place by praying two rak'ahs."
Abu Bakr bin Abi Shaybah, Abu Ya'la and al-Bayhaqi in al-Kubra recorded this hadith with a chain all of whose narrators are thiqat (trustworthy), and al-Bazzar also recorded it.
Hadith Takhrij«رواه أبو بكر بن أبي شيبة وأبو يعلى والبيهقي في الكبرى بسند رجاله ثقات، ورواه البزار» «أخرجه سنن الدارمي برقم: 2681، وأخرجه المعجم الأوسط للطبراني برقم: 34665»