Sahih Bukhari – Hadith No : 1558

Narrated Ibn `Umar: Allah’s Apostle used to go (for Hajj) via Ash-Shajara way and return via Muarras way; and no doubt, whenever Allah’s Apostle went to Mecca, he used to offer the prayer in the Mosque of Ash-Shajara; and on his return, he used to offer the prayer at Dhul-Hulaifa in the middle of the valley, and pass the night there till morning.

Hadith In Arabic Text :

حدثنا إبراهيم بن المنذر، حدثنا أنس بن عياض، عن عبيد الله، عن نافع، عن عبد الله بن عمر رضى الله عنهما أن رسول الله صلى الله عليه وسلم كان يخرج من طريق الشجرة، ويدخل من طريق المعرس، وأن رسول الله صلى الله عليه وسلم كان إذا خرج إلى مكة يصلي في مسجد الشجرة، وإذا رجع صلى بذي الحليفة ببطن الوادي، وبات حتى يصبح‏.‏

Chapter : Hajj (Pilgrimage) – كتاب الحج