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.
darimi:1430Saʿīd b. Manṣūr > ʿAbd al-ʿAzīz b. Muḥammad > Saʾaltuh ʿAnh > ʿAmr b. Yaḥyá from his father > Abū Saʿīd al-Khudrī

[Machine] The Messenger of Allah ﷺ said, "The whole earth is a mosque except for the graveyard and the bathroom." It was asked to Abu Muhammad, "Is prayer allowed in the graveyard?" He said, "Yes, if it is not on the grave." And the narration says that most of them transmitted it.  

الدارمي:١٤٣٠أَخْبَرَنَا سَعِيدُ بْنُ مَنْصُورٍ حَدَّثَنَا عَبْدُ الْعَزِيزِ بْنُ مُحَمَّدٍ أَنَا سَأَلْتُهُ عَنْهُ قَالَ أَخْبَرَنِي عَمْرُو بْنُ يَحْيَى عَنْ أَبِيهِ عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ قَالَ

قَالَ رَسُولُ اللَّهِ ﷺ «الْأَرْضُ كُلُّهَا مَسْجِدٌ إِلَّا الْمَقْبَرَةَ وَالْحَمَّامَ» قِيلَ لِأَبِي مُحَمَّدٍ تُجْزِئُ الصَّلَاةُ فِي الْمَقْبَرَةِ؟ قَالَ إِذَا لَمْ تَكُنْ عَلَى الْقَبْرِ فَنَعَمْ وَقَالَ الْحَدِيثُ أَكْثَرُهُمْ أَرْسَلُوهُ