Hadith 3234
Narrated Abu Hurairah: The Messenger of Allah ﷺ visited his mother's grave and wept and cause those around him to weep. The Messenger of Allah ﷺ then said: I asked my Lord's permission to pray for forgiveness for her, but I was not allowed. I then asked His permission to visit her grave, and I was allowed. So visit graves, for they make one mindful of death.
Hadith 3235
Narrated Buraidah: The Messenger of Allah ﷺ as saying: I forbade you to visit graves, but you may now visit them, for in visiting them there is a reminder (of death).