The Messenger of Allah ﷺ said, "The earth has been made for me a means of purification and a place of prayer."
حدثنا عثمان بن أبي شيبة حدثنا جرير عن الأعمش عن مجاهد عن عبيد بن عمير
قال رسول الله ﷺ جعلت لي الأرض طهورا ومسجدا
[Sahih]. Ahmad reported it, 5/145, from the hadith of Amash, at length, and Ibn Hibban graded it sahih, no. 200. It has corroborating narrations in Bukhari, 1/436, and Muslim, no. 521, and others.