Language:
كتاب الجنائز
23  
Funerals (Al-Janaa'iz)
(31)
Chapter: Visiting the graves
(31)
باب زِيَارَةِ الْقُبُورِ
Sahih al-Bukhari 1283

Narrated Anas bin Malik:

The Prophet (ﷺ) passed by a woman who was weeping beside a grave. He told her to fear Allah and be patient. She said to him, "Go away, for you have not been afflicted with a calamity like mine." And she did not recognize him. Then she was informed that he was the Prophet (ﷺ) . so she went to the house of the Prophet (ﷺ) and there she did not find any guard. Then she said to him, "I did not recognize you." He said, "Verily, the patience is at the first stroke of a calamity."

حَدَّثَنَا آدَمُ، حَدَّثَنَا شُعْبَةُ، حَدَّثَنَا ثَابِتٌ، عَنْ أَنَسِ بْنِ مَالِكٍ ـ رضى الله عنه ـ قَالَ مَرَّ النَّبِيُّ صلى الله عليه وسلم بِامْرَأَةٍ تَبْكِي عِنْدَ قَبْرٍ فَقَالَ ‏"‏ اتَّقِي اللَّهَ وَاصْبِرِي ‏"‏‏.‏ قَالَتْ إِلَيْكَ عَنِّي، فَإِنَّكَ لَمْ تُصَبْ بِمُصِيبَتِي، وَلَمْ تَعْرِفْهُ‏.‏ فَقِيلَ لَهَا إِنَّهُ النَّبِيُّ صلى الله عليه وسلم‏.‏ فَأَتَتْ باب النَّبِيِّ صلى الله عليه وسلم فَلَمْ تَجِدْ عِنْدَهُ بَوَّابِينَ فَقَالَتْ لَمْ أَعْرِفْكَ‏.‏ فَقَالَ ‏"‏ إِنَّمَا الصَّبْرُ عِنْدَ الصَّدْمَةِ الأُولَى ‏"‏‏.‏
Reference : Sahih al-Bukhari 1283
In-book reference : Book 23, Hadith 43
USC-MSA web (English) reference : Vol. 2, Book 23, Hadith 372
  (deprecated numbering scheme)