The Messenger of Allah ﷺ said, "The earth has been made for me a place of prayer and a means of purification." Abridged.
قال رسول الله ﷺ: جعلت لي الأرض مسجدا وطهورا. مختصرا.
Muslim reported it in the Book of Mosques (523) via Ismail bin Jafar, from Ala, from his father, from Abu Hurairah, in a lengthy hadith.