Sahih Muslim 976
Sahih Muslim · Book 11: The Book of Prayer - Funerals · The prophet (saws) asked his Lord for permission to visit the grave of his mother
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.