The Messenger of Allah ﷺ went out one day and prayed over the people of Uhud the prayer for the dead, then he departed.
حدثنا قتيبة بن سعيد حدثنا الليث عن يزيد بن أبي حبيب عن أبي الخير
أن رسول الله ﷺ خرج يوما فصلى على أهل أحد صلاته على الميت ثم انصرف
Bukhari narrated it in the Book of Raqaiq, Chapter on What Should Be Guarded Against Regarding the Splendor of This World and Competing for It, hadith 6426, and Muslim narrated it in the Book of Virtues, Chapter on Confirming Our Prophet's Basin and Its Description, hadith 2296, both from Qutayba with this wording.