It is narrated from Sayyiduna Anas (may Allah be pleased with him) that he said: "I was praying facing a grave when Sayyiduna Umar (may Allah be pleased with him) saw me, and he began calling out (to warn me): 'The grave! The grave!' I did not understand what he meant, and (thinking that perhaps there was some sign in the sky) I raised my head upwards. Then he explained, saying: 'The grave is right in front of you (i.e. do not face it).'" A similar narration is also reported by Mansur through al-Hasan al-Basri from Sayyiduna Anas (may Allah be pleased with him) on the authority of Sayyiduna Umar (may Allah be pleased with him). This hadith is sahih (authentic), and Imam al-Bukhari narrated it in his Sahih in mu'allaq form (without its chain).
Hadith Referenceإتحاف الخيرة المهرة بزوائد المسانيد العشرة / كتاب القبلة وفيه ستر العورة وما يصلى فيه / 1129
Hadith Gradingمحدثین:إسناده صحيح
Hadith Takhrij«هذا حديث صحيح، رواه البخاري في صحيحه تعليقا»
It is narrated from Sayyiduna Anas bin Malik (may Allah be pleased with him) that "the Prophet (peace and blessings be upon him) forbade praying between graves", and in another chain it is also narrated from Sayyiduna Anas bin Malik (may Allah be pleased with him) himself that "praying between graves was forbidden." Imam al-Bazzar said that narrators other than Hafs bin Ghiyath narrated this hadith from Ash'ath, and he from Imam al-Hasan al-Basri, as 'mursal', and no one except Hafs mentioned Sayyiduna Anas (may Allah be pleased with him) in it.
Hadith Referenceإتحاف الخيرة المهرة بزوائد المسانيد العشرة / كتاب القبلة وفيه ستر العورة وما يصلى فيه / 1130
Hadith Gradingمحدثین:سكت عنه البوصيري، إسناده ضعيف؛ الحسن البصري مدلس وقد عنعن، وأعله البزار بالإرسال
Hadith Takhrij«تفرد حفص بن غياث بوصله عن أشعث، ورواه غيره عن أشعث عن الحسن مرسلا (قول البزار في المتن)؛ الحسن: يرسل ويدلس» «أخرجه مصنف ابن أبي شيبة برقم: 1، وأخرجه صحيح ابن حبان برقم: 2318، وأخرجه البحر الزخار المعروف بمسند البزار 10 - 18 برقم: 6487، 6660»