and he said:
“Whoever swears an oath by other than Allah has associated partners with Him.”
He also said:
“Do not praise me excessively as the Christians praised Jesus, son of Mary. I am only a servant, so say: ‘The servant of Allah and His Messenger.’”
For this reason, the scholars agree that no one may swear by any created thing, such as the Kaaba or anything similar.
The Prophet, may Allah bless him and grant him peace, forbade prostrating to him. When one of his Companions prostrated to him, he forbade him from doing so and said:
“Prostration is fitting only for Allah.”
He also said:
“If I were to command anyone to prostrate to another, I would command a woman to prostrate to her husband.”
He said to Mu‘ādh ibn Jabal, may Allah be pleased with him: “Tell me, if you passed by my grave, would you prostrate to it?” He replied, “No.” He said, “Then do not prostrate to me.”
The Prophet, may Allah bless him and grant him peace, also forbade taking graves as places of prayer. During his final illness, he said:
“May Allah curse the Jews and Christians; they took the graves of their prophets as places of prayer.”
He was warning against what they had done. ‘Ā’ishah, may Allah be pleased with her, said: “Were it not for that, his grave would have been placed in the open, but he disliked its being made a place of prayer.”
It is also reported in the authentic hadith collection that, five days before his death, he, may Allah bless him and grant him peace, said:
“Those before you used to take graves as places of prayer. So do not make my house a place of recurring gatherings, nor make your houses graves. Invoke blessings upon me wherever you are, for your invocations of blessings reach me.”
For this reason, the leading scholars of Islam agree that building a mosque over graves is not prescribed, nor is praying beside graves prescribed. Indeed, many scholars hold that prayer performed beside them is invalid.