The Messenger of Allah ﷺ said, "I sought my Lord's permission to ask forgiveness for my mother, but He did not grant it to me. Then I sought His permission to visit her grave, and He granted it to me."In another narration, Abu Hurairah said, "The Prophet ﷺ visited his mother's grave and wept, and those around him wept as well."He said, "I sought my Lord's permission to ask forgiveness for her, but I was not granted permission. Then I sought His permission to visit her grave, and I was granted permission. So visit the graves, for they remind you of death."
قال رسول الله ﷺ: استأذنت ربي أن أستغفر لأمي فلم يأذن لي، واستأذنته أن أزور قبرها فأذن لي. وفي رواية قال أبو هريرة: زار النبي ﷺ قبر أمه، فبكى وأبكى من حوله، فقال: استأذنت ربي في أن أستغفر لها فلم يؤذن لي، واستأذنته في أن أزور قبرها فأذن لي، فزوروا القبور، فإنها تذكر الموت.
Muslim narrated it in the Book of Funerals (976) through several routes from Marwan bin Muawiya, from Yazid bin Kaysan, from Abu Hazim, from Abu Hurairah, who related the hadith in a similar way. The second narration was reported by Muhammad bin Ubayd, from Yazid bin Kaysan, with his chain, in the same way.Baghawi, may Allah have mercy on him, said, "It is said that his mother's grave was at Abwa, and he passed by it in the year of Hudaybiya. It is also reported that he visited his mother's grave with a thousand muqanna, meaning a thousand horsemen covered in armor." Sharh al-Sunnah (5/463).As for his statement, "I asked my Lord's permission to seek forgiveness for my mother," it is possible that this request for permission came before the revelation of Allah's words, "It is not for the Prophet and those who believe to seek forgiveness for the polytheists, even if they be close relatives" [Tawbah 9:113], and it is possible that it came after that, and he hoped for a special exception to be made for his mother in this regard.In this hadith is evidence for the permissibility of visiting the graves of polytheists for admonition and remembrance through viewing their graves, and this is supported by the end of the hadith, "So visit the graves, for they remind one of death," since in this respect the grave of the Muslim and the polytheist are the same.