The saying of the Exalted: "And to Allah belong the East and the West."
Muhammad said: The meaning is: He is their Creator. "So wherever you turn, there is the Face of Allah." Some said: It means: there is the Qiblah (direction of prayer) of Allah.
Yahya [narrated] from Ash'ath, from Asim ibn Ubayd Allah al-Umari, from Abd Allah ibn Amir ibn Rabi'ah, from his father, "that the Messenger of Allah (ﷺ) was on a journey and they stopped at a campsite on a dark night. One of them began collecting pebbles and made them into a mosque to pray. When they reached the morning, they realized they had been facing other than the Qiblah, so Allah (Glorified and Exalted is He) revealed: 'And to Allah belong the East and the West' [up to the end of] the verse."