Jabir bin Abdullah reported,

I set out with the Messenger of Allah ﷺ on a military expedition. My camel grew slow and exhausted, so the Messenger of Allah ﷺ arrived before me. I arrived in the morning and went to the mosque, where I found him at its door.He asked, "Have you only just arrived?"I replied, "Yes."He said, "Leave your camel and go in to pray two units of prayer."So I went in and prayed, then returned.

Azami 3035

Sahih

عن جابر بن عبد الله قال

خرجت مع رسول الله ﷺ في غزاة، فأبطأ بي جملي وأعيا. ثم قدم رسول الله ﷺ قبلي، وقدمت بالغداة، فجئت المسجد فوجدته على باب المسجد. قال: الآن حين قدمت؟ قلت: نعم، قال: فدع جملك وادخل فصل ركعتين قال: فدخلت فصليت، ثم رجعت.

الأعظمي 3035صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Mosques
Section
Recommendation of praying two rakahs in the masjid upon returning from a journey at the time of arrival
Numbering
Jami al-Kamil 3035 (2nd edition)
Azami 3035