Compiled by Imam Muhammad al-Bukhari
حَدَّثَنَا أَحْمَدُ بْنُ الْحَجَّاجِ، حَدَّثَنَا أَنَسُ بْنُ عِيَاضٍ، عَنْ عُبَيْدِ اللَّهِ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ ـ رضى الله عنهما ـ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم كَانَ إِذَا خَرَجَ إِلَى مَكَّةَ يُصَلِّي فِي مَسْجِدِ الشَّجَرَةِ، وَإِذَا رَجَعَ صَلَّى بِذِي الْحُلَيْفَةِ بِبَطْنِ الْوَادِي وَبَاتَ حَتَّى يُصْبِحَ.
Whenever Allah's Messenger (ﷺ) left for Mecca, he used to pray in the mosque of Ash-Shajra, and when he returned (to Medina), he used to pray in the middle of the valley of Dhul-Hulaifa and used to pass the night there till morning.