حَدَّثَنَا مُحَمَّدُ بْنُ مَنْصُورٍ الطُّوسِيُّ، حَدَّثَنَا يَعْقُوبُ، حَدَّثَنَا أَبِي، عَنِ ابْنِ إِسْحَاقَ، حَدَّثَنِي نَافِعٌ، عَنِ ابْنِ عُمَرَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلمحِينَ أَقْبَلَ مِنْ حَجَّتِهِ دَخَلَ الْمَدِينَةَ فَأَنَاخَ عَلَى بَابِ مَسْجِدِهِ ثُمَّ دَخَلَهُ فَرَكَعَ فِيهِ رَكْعَتَيْنِ ثُمَّ انْصَرَفَ إِلَى بَيْتِهِ ‏.‏قَالَ نَافِعٌ فَكَانَ ابْنُ عُمَرَ كَذَلِكَ يَصْنَعُ
Translation
Narrated Abdullah ibn Umar

When the Messenger of Allah (ﷺ) arrived from his Hajj, he entered Medina and made his mount kneel at the gate of his mosque. Then he entered it and performed two rak'ahs of prayer in it, after which he returned to his home.

Nafi' said: Ibn Umar used to do likewise.