In Sahīh Muslim, the Prophet—may Allah bless him and grant him peace—said:
“Do not sit on graves, and do not pray toward them.” (1)
He thus prohibited praying toward graves because this resembles the polytheists who prostrate themselves to them. In the Sunan collections and the Musnad, he also said:
“The entire earth is a place of prayer except graveyards and bathhouses.” (2)
According to the sounder of the two scholarly opinions, prayer in graveyards was prohibited in order to block the means leading to polytheism. Similarly, prayer was prohibited at sunrise and sunset, for the sun rises between the two horns of Satan, and the polytheists prostrate themselves to it at those times. Deliberately praying at those times was therefore prohibited because it outwardly resembles their practice, even though the intention differs.
Likewise, prayer to Allah in a graveyard was prohibited because it resembles the practice of those who take graves as places of worship. One who prays to Allah must therefore not deliberately choose to do so there, in order to block the means leading to polytheism. If, however, a person deliberately prays there so that he may supplicate (3) beside the graves, believing that supplication is more likely to be answered there, this is misguidance by the consensus of the Muslims and is among the things that Allah and His Messenger have forbidden.
More serious still is to call upon the deceased and adjure Allah by him. More serious still is to—