Sahih Muslim , Book 4, Hadith 2130 (USC-MSA) ⓘ
Abu Huraira reported: The Apostle of Allah visited the grave of his mother and he wept, and moved others around him to tears, and said: I sought permission from my Lord to beg forgiveness for her but it was not granted to me, and I sought permission to visit her grave and it was granted to me so visit the graves, for that makes you mindful of death.
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، وَزُهَيْرُ بْنُ حَرْبٍ، قَالاَ حَدَّثَنَا مُحَمَّدُ بْنُ عُبَيْدٍ، عَنْ يَزِيدَ بْنِ كَيْسَانَ، عَنْ أَبِي حَازِمٍ، عَنْ أَبِي هُرَيْرَةَ، قَالَ زَارَ النَّبِيُّ صلى الله عليه وسلم قَبْرَ أُمِّهِ فَبَكَى وَأَبْكَى مَنْ حَوْلَهُ فَقَالَ " اسْتَأْذَنْتُ رَبِّي فِي أَنْ أَسْتَغْفِرَ لَهَا فَلَمْ يُؤْذَنْ لِي وَاسْتَأْذَنْتُهُ فِي أَنْ أَزُورَ قَبْرَهَا فَأُذِنَ لِي فَزُورُوا الْقُبُورَ فَإِنَّهَا تُذَكِّرُ الْمَوْتَ " .
also referenced under: Book 11, Hadith 135 (In-Book) & Hadith 976 (Reference)