Abu Huraira reported:
The Apostle of Allah (s.a.w.a.) 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.
It was narrated that Abu Hurairah said:
“The Prophet (s.a.w.a.) visited the grave of his mother and wept, causing the people around him to weep. Then he said: ‘I asked my Lord for permission to seek forgiveness for her, but He did not give me permission. Then I asked my Lord for permission to visit her grave and He gave me permission. So visit the graves, for they will remind you of death.’”