Mishkat al-Masabih 129
Zaid b. Thabit said:
While we were accompanying God’s messenger who was riding a she-mule in a garden belonging to the B. an-Najjar, the animal shied and almost unseated him. It happened that there were five or six graves there, so he asked if anyone knew who were buried in them. A man replied that he did, and on being asked when they died said it was in the period when the people were polytheists. The Prophet then said, “These people are being afflicted in their graves, and were it not that you would cease to bury, I would ask God to let you hear the punishment in the grave which I am hearing.” Then he turned facing us and said, “Seek refuge in God from the punishment of the fire.” They said, “We seek refuge in God from the punishment of the fire.” He said, “Seek refuge in God from the punishment in the grave.” They said, “We seek refuge in God from the punishment in the grave.” He said, “Seek refuge in God from trials both open and secret.” They said, “We seek refuge in God from trials both open and secret.” He said, “Seek refuge in God from the trial of ad-Dajjal!” They said, “We seek refuge in God from the trial of ad-Dajjal.” 

Muslim transmitted it.
عَن زيد بن ثَابت قَالَ بَيْنَمَا النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فِي حَائِطٍ لِبَنِي النَّجَّارِ عَلَى بَغْلَةٍ لَهُ وَنَحْنُ مَعَهُ إِذْ حَادَتْ بِهِ فَكَادَتْ تُلْقِيهِ وَإِذَا أَقْبُرُ سِتَّةٍ أَو خَمْسَة أَو أَرْبَعَة قَالَ كَذَا كَانَ يَقُول الْجريرِي فَقَالَ: «من يعرف أَصْحَاب هَذِه الأقبر فَقَالَ رجل أَنا قَالَ فَمَتَى مَاتَ هَؤُلَاءِ قَالَ مَاتُوا فِي الْإِشْرَاك فَقَالَ إِنَّ هَذِهِ الْأُمَّةَ تُبْتَلَى فِي قُبُورِهَا فَلَوْلَا أَنْ لَا تَدَافَنُوا لَدَعَوْتُ اللَّهَ أَنْ يُسْمِعَكُمْ مِنْ عَذَابِ الْقَبْرِ الَّذِي أَسْمَعُ مِنْهُ ثُمَّ أَقْبَلَ عَلَيْنَا بِوَجْهِهِ فَقَالَ تَعَوَّذُوا بِاللَّهِ مِنْ عَذَابِ النَّارِ قَالُوا نَعُوذُ بِاللَّهِ مِنْ عَذَاب النَّار فَقَالَ تَعَوَّذُوا بِاللَّهِ مِنْ عَذَابِ الْقَبْرِ قَالُوا نَعُوذُ بِاللَّه من عَذَاب الْقَبْر قَالَ تَعَوَّذُوا بِاللَّهِ مِنَ الْفِتَنِ مَا ظَهَرَ مِنْهَا وَمَا بَطَنَ قَالُوا نَعُوذُ بِاللَّهِ مِنَ الْفِتَنِ مَا ظَهَرَ مِنْهَا وَمَا بَطَنَ قَالَ تَعَوَّذُوا بِاللَّهِ مِنْ فِتْنَةِ الدَّجَّالِ قَالُوا نَعُوذُ بِاللَّهِ مِنْ فِتْنَةِ الدَّجَّالِ» . رَوَاهُ مُسْلِمٌ