Mishkat al-Masabih 1765
عَنِ ابْنِ عَبَّاسٍ قَالَ: مَرَّ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ بِقُبُورٍ بِالْمَدِينَةِ فَأَقْبَلَ عَلَيْهِمْ بِوَجْهِهِ فَقَالَ: «السَّلَامُ عَلَيْكُمْ يَا أَهْلَ الْقُبُورِ يَغْفِرُ اللَّهُ لَنَا وَلَكُمْ أَنْتُمْ سَلَفُنَا وَنَحْنُ بِالْأَثَرِ» . رَوَاهُ التِّرْمِذِيُّ وَقَالَ: هَذَا حَدِيثٌ حَسَنٌ غَرِيبٌ
From Ibn ʿAbbas, who said: The Prophet ﷺ passed by some graves in Madinah, turned his face towards them and said: "Peace be upon you, O people of the graves. May Allah forgive us and you. You have gone before us, and we are following in [your] tracks." Reported by at-Tirmidhi, and he said: "This is a hasan gharib hadith."