Sahih Muslim, Book 11, Hadith 127 (Muslim 2227)

Abu Marthad al-Ghanawi reported Allah's Messenger (ﷺ) as saying:

Do not pray facing towards the graves, and do not sit on them.