The Messenger of Allah ﷺ passed by the graves of Madinah, turned his face toward them, and said, "Peace be upon you, people of the graves. May Allah forgive us and you. You have gone before us, and we are following your trail."
حدثنا أبو كريب حدثنا محمد بن الصلت عن أبي كدينة عن قابوس بن أبي ظبيان عن أبيه
مر رسول الله ﷺ بقبور المدينة فأقبل عليهم بوجهه فقال السلام عليكم يا أهل القبور يغفر الله لنا ولكم أنتم سلفنا ونحن بالأثر
No references are available.
[Its chain is daif]. Tabarani also narrated it in al-Kabir: 12/107, 108, no. 12613, from the hadith of Abu Kudayna, in it is Qabus, who has some looseness in him (Taqrib). Part of the hadith has supporting narrations.Other narrations on this subject come from Burayda [Muslim, no. 975] and Ayesha [Muslim, no. 974].