Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:7212Abū ʿAbdullāh al-Ḥāfiẓ And ʾAbū Zakariyyā b. Abū Isḥāq al-Muzakkī > Abū Bakr Aḥmad b. Salmān al-Faqīh > Quriʾ > Yaḥyá b. Jaʿfar > Abū Aḥmad al-Zubayrī > Sufyān al-Thawrī > ʿAlqamah b. Marthad > Sulaymān b. Buraydah from his father

[Machine] The Messenger of Allah ﷺ used to teach them when they entered the graves, and he would say to them, "Peace be upon you, O people of the dwellings, from the believers and the Muslims. Indeed, if Allah wills, we will join you. We ask Allah for well-being for us and for you."  

البيهقي:٧٢١٢وَأَخْبَرَنَا أَبُو عَبْدِ اللهِ الْحَافِظُ وَأَبُو زَكَرِيَّا بْنُ أَبِي إِسْحَاقَ الْمُزَكِّي قَالَا ثنا أَبُو بَكْرٍ أَحْمَدُ بْنُ سَلْمَانَ الْفَقِيهُ قَالَ قُرِئَ عَلَى يَحْيَى بْنِ جَعْفَرٍ وَأَنَا أَسْمَعُ قَالَ أنبأ أَبُو أَحْمَدَ الزُّبَيْرِيُّ ثنا سُفْيَانُ الثَّوْرِيُّ عَنْ عَلْقَمَةَ بْنِ مَرْثَدٍ عَنْ سُلَيْمَانَ بْنِ بُرَيْدَةَ عَنْ أَبِيهِ قَالَ

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

رَوَاهُ مُسْلِمٌ فِي الصَّحِيحِ عَنْ زُهَيْرِ بْنِ حَرْبٍ وَغَيْرِهِ عَنْ أَبِي أَحْمَدَ مُحَمَّدِ بْنِ عَبْدِ اللهِ الْأَسَدِيِّ الزُّبَيْرِيِّ وَرَوَاهُ مُحَمَّدُ بْنُ يُوسُفَ الْفِرْيَابِيُّ عَنِ الثَّوْرِيِّ فَزَادَ فِيهِ شَيْئًا

See similar narrations below:

Collected by Muslim, Ibn Mājah, Aḥmad
muslim:975Abū Bakr b. Abū Shaybah And Zuhayr b. Ḥarb > Muḥammad b. ʿAbdullāh al-Asadī > Sufyān > ʿAlqamah b. Marthad > Sulaymān b. Buraydah from his father

" Peace be upon the inhabitants of the city (i. e. graveyard)." In the hadith transmitted by Zuhair (the words are):" Peace be upon you, the inhabitants of the city, among the believers, and Muslims, and God willing we shall join you. I beg of Allah peace for us and for you."  

مسلم:٩٧٥حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ وَزُهَيْرُ بْنُ حَرْبٍ قَالاَ حَدَّثَنَا مُحَمَّدُ بْنُ عَبْدِ اللَّهِ الأَسَدِيُّ عَنْ سُفْيَانَ عَنْ عَلْقَمَةَ بْنِ مَرْثَدٍ عَنْ سُلَيْمَانَ بْنِ بُرَيْدَةَ عَنْ أَبِيهِ قَالَ

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

ibnmajah:1547Muḥammad b. ʿAbbād b. Ādam > Abū Aḥmad > Sufyān > ʿAlqamah b. Marthad > Sulaymān b. Buraydah from his father

“The Messenger of Allah ﷺ used to teach them, when they went out to the graveyard, to say: As-salamu ‘alaykum ahlad-diyar minal-mu’minina wal- muslimin, wa inna insha’ Allah bikum lahiqun, nas’alul-laha lana wa lakumul-‘afiyah (Peace be upon you, O inhabitants of the abodes, believers and Muslims, and we will join you soon if Allah wills. We ask Allah for well-being for us and for you).’”  

ابن ماجة:١٥٤٧حَدَّثَنَا مُحَمَّدُ بْنُ عَبَّادِ بْنِ آدَمَ حَدَّثَنَا أَبُو أَحْمَدَ حَدَّثَنَا سُفْيَانُ عَنْ عَلْقَمَةَ بْنِ مَرْثَدٍ عَنْ سُلَيْمَانَ بْنِ بُرَيْدَةَ عَنْ أَبِيهِ قَالَ

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

ahmad:22985Muʿāwiyah b. Hishām And ʾAbū Aḥmad > Sufyān > ʿAlqamah b. Marthad > Sulaymān b. Buraydah from his father

“The Messenger of Allah ﷺ used to teach them, when they went out to the graveyard, to say: As-salamu ‘alaykum ahlad-diyar minal-mu’minina wal- muslimin, wa inna insha’ Allah bikum lahiqun, nas’alul-laha lana wa lakumul-‘afiyah (Peace be upon you, O inhabitants of the abodes, believers and Muslims, and we will join you soon if Allah wills. We ask Allah for well-being for us and for you).’” (Using translation from Ibn Mājah 1547)   

أحمد:٢٢٩٨٥حَدَّثَنَا مُعَاوِيَةُ بْنُ هِشَامٍ وَأَبُو أَحْمَدَ قَالَا حَدَّثَنَا سُفْيَانُ عَنْ عَلْقَمَةَ بْنِ مَرْثَدٍ عَنْ سُلَيْمَانَ بْنِ بُرَيْدَةَ عَنْ أَبِيهِ قَالَ

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