The Messenger of Allah ﷺ said, "The earth has been made for me a place of prayer and a means of purification. Wherever the time of prayer overtakes me, I wipe myself for purification and pray. Those before me used to regard this as a serious matter, for they would only pray in their churches and synagogues..." This is an abridged version.
أن رسول الله ﷺ قال: جعلت لي الأرض مساجد وطهورا أينما أدركتني الصلاة تمسحت وصليت، وكان من قبلي يعظمون ذلك، إنما كانوا يصلون في كنائسهم وبيعهم… مختصرا.
Ahmad (7068) reported it, saying, Qutayba bin Saeed narrated to us, Bakr bin Mudar narrated to us, from Ibn Hadi, from Amr bin Shuayb, from his father, from his grandfather, and he mentioned the hadith in full.Ibn Hadi is Yazid bin Abdullah bin Usama bin Had Laythi, Abu Abdullah Madani. Its chain is hasan because of Amr bin Shuayb, for he is truthful.Haythami cited it in Majma and said, "Ahmad reported it, and its narrators are trustworthy."