Sunan Abi Dawud, Hadith 3228 ⓘ
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.
حَدَّثَنَا مُحَمَّدُ بْنُ سُلَيْمَانَ الأَنْبَارِيُّ، حَدَّثَنَا مُحَمَّدُ بْنُ عُبَيْدٍ، عَنْ يَزِيدَ بْنِ كَيْسَانَ، عَنْ أَبِي حَازِمٍ، عَنْ أَبِي هُرَيْرَةَ، قَالَ أَتَى رَسُولُ اللَّهِ صلى الله عليه وسلم قَبْرَ أُمِّهِ فَبَكَى وَأَبْكَى مَنْ حَوْلَهُ فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " اسْتَأْذَنْتُ رَبِّي تَعَالَى عَلَى أَنْ أَسْتَغْفِرَ لَهَا فَلَمْ يُؤْذَنْ لِي فَاسْتَأْذَنْتُ أَنْ أَزُورَ قَبْرَهَا فَأُذِنَ لِي فَزُورُوا الْقُبُورَ فَإِنَّهَا تُذَكِّرُ بِالْمَوْتِ " .
also referenced under: Hadith 3234 (DarusSalam)