Sunan Ibn Majah, Book 25, Hadith 3072 (In-Book) ⓘ
It was narrated from Ibn ‘Umar that the Messenger of Allah came and performed Tawaf around the House seven times, then he prayed two Rak’ahs. Waki’ said: “Meaning, at the Maqam,* then he went out to Safa.”
حَدَّثَنَا عَلِيُّ بْنُ مُحَمَّدٍ، وَعَمْرُو بْنُ عَبْدِ اللَّهِ، قَالاَ حَدَّثَنَا وَكِيعٌ، عَنْ مُحَمَّدِ بْنِ ثَابِتٍ الْعَبْدِيِّ، عَنْ عَمْرِو بْنِ دِينَارٍ، عَنِ ابْنِ عُمَرَ، أَنَّ رَسُولَ اللَّهِ ـ صلى الله عليه وسلم ـ قَدِمَ فَطَافَ بِالْبَيْتِ سَبْعًا ثُمَّ صَلَّى رَكْعَتَيْنِ - قَالَ وَكِيعٌ يَعْنِي عِنْدَ الْمَقَامِ - ثُمَّ خَرَجَ إِلَى الصَّفَا .
also referenced under: Hadith 2959 (Reference) & Volume 4, Book 25, Hadith 2959 (DarusSalam)