Hadith on Graves: Supplication for visiting graveyards

Buraydah reported: The Messenger of Allah, peace and blessings be upon him, used to teach them as they went to visit the graves, saying to their inhabitants, “Peace be upon you, O people of this abode, from the believers and the Muslims. We will soon, if Allah wills, be joining you. I ask Allah to grant well-being to us and to you.

Source: Ṣaḥīḥ Muslim 975

Grade: Sahih (authentic) according to Muslim

عَنْ بُرَيْدَة كَانَ رَسُولُ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ يُعَلِّمُهُمْ إِذَا خَرَجُوا إِلَى الْمَقَابِرِ فَكَانَ قَائِلُهُمْ يَقُولُ السَّلَامُ عَلَيْكُمْ أَهْلَ الدِّيَارِ مِنَ الْمُؤْمِنِينَ وَالْمُسْلِمِينَ وَإِنَّا إِنْ شَاءَ اللهُ لَلَاحِقُونَ أَسْأَلُ اللهَ لَنَا وَلَكُمُ الْعَافِيَةَ

975 صحيح مسلم كتاب الجنائز باب ما يقال عند دخول القبور والدعاء لأهلها