The Messenger of Allah ﷺ prayed over those slain at Uhud eight years later, as though bidding farewell to the living and the dead. Then he ascended the pulpit and said, "I will precede you, and I will be a witness over you. Your appointed meeting place is the Pond, and I can see it now from where I stand. I do not fear that you will associate partners with Allah, but I fear that you will compete with one another for worldly gain."The narrator said, "That was the last glance I ever cast upon the Messenger of Allah ﷺ."
صلى رسول الله ﷺ على قتلى أحد بعد ثماني سنين كالمودع للأحياء والأموات، ثم طلع على المنبر فقال: إني بين أيديكم فرط، وأنا عليكم شهيد، وإن موعدكم الحوض، وإني لأنظر إليه من مقامي هذا، وإني لست أخشى عليكم أن تشركوا، ولكني أخشى عليكم الدنيا أن تنافسوا قال: فكانت آخر نطرة نظرتها إلى رسول الله ﷺ.
Bukhari related it in the Book of Military Expeditions (4042), and Muslim in the Book of Virtues (2296), both from the hadith of Yazid bin Abu Habib, from Abu Khayr, from Uqba bin Amir, who related it. The wording given here is Bukhari's, and Muslim's wording is close to it, containing, "So he prayed over the people of Uhud with his prayer over the dead."Bayhaqi and others interpreted the prayer here as meaning supplication, because if the prayer of the funeral had been intended, he would not have delayed it for such a long period. Shafii spoke at length in refutation of those who held that he prayed the funeral prayer over them, and Bayhaqi quoted this in Marifah (3/143–144).Furthermore, the hadith of Uqba bin Amir does not provide evidence for those who permit the funeral prayer over martyrs, since they do not hold that it may be delayed more than three days.The truth in this matter is what Hafiz bin Qayyim said, "The correct view in this matter is that one has a choice between praying over them and not doing so, since the reports have come with both of these practices. This is one of the narrations from Imam Ahmad, and it is the most fitting with his principles and his school." Tahzib Sunan (4/295).