Abu Dharr reported,

I entered the mosque just as the sun was setting, and the Prophet ﷺ was sitting there. He said, "Abu Dharr, do you know where this sun goes?"I said, "Allah and His Messenger know best."He said, "It goes to seek permission to prostrate, and permission is granted to it. But it is as though it will be told, 'Rise from where you came,' so it will rise from its place of setting."Then he recited, "And that is its resting place." He said, and that is the recitation of Abdullah bin Masud.

Tirmidhi 2186

Sahih

حدثنا هناد حدثنا أبو معاوية عن الأعمش عن إبراهيم التيمي عن أبيه

عن أبي ذر قال

دخلت المسجد حين غابت الشمس والنبي ﷺ جالس فقال يا أبا ذر أتدري أين تذهب هذه قال قلت الله ورسوله أعلم قال فإنها تذهب تستأذن في السجود فيؤذن لها وكأنها قد قيل لها اطلعي من حيث جئت فتطلع من مغربها قال ثم قرأ وذلك مستقر لها قال وذلك قراءة عبد الله بن مسعود

الترمذي 2186صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Tribulations
Chapter
Rising of the sun from the west
Numbering
Darussalam 2186
Tirmidhi 2186