Language:
كتاب الأدب
78  
Good Manners and Form (Al-Adab)
(13)
Chapter: Allah will keep good relations with him who keeps good relations with kith and kin
(13)
باب مَنْ وَصَلَ وَصَلَهُ اللَّهُ
Sahih al-Bukhari 5987

Narrated Abu Huraira:

The Prophet (ﷺ) said, "Allah created the creations, and when He finished from His creations, Ar-Rahm i.e., womb said, "(O Allah) at this place I seek refuge with You from all those who sever me (i.e. sever the ties of Kith and kin). Allah said, 'Yes, won't you be pleased that I will keep good relations with the one who will keep good relations with you, and I will sever the relation with the one who will sever the relations with you.' It said, 'Yes, O my Lord.' Allah said, 'Then that is for you ' " Allah's Messenger (ﷺ) added. "Read (in the Qur'an) if you wish, the Statement of Allah: 'Would you then, if you were given the authority, do mischief in the land and sever your ties of kinship?' (47.22)

حَدَّثَنِي بِشْرُ بْنُ مُحَمَّدٍ، أَخْبَرَنَا عَبْدُ اللَّهِ، أَخْبَرَنَا مُعَاوِيَةُ بْنُ أَبِي مُزَرِّدٍ، قَالَ سَمِعْتُ عَمِّي، سَعِيدَ بْنَ يَسَارٍ يُحَدِّثُ عَنْ أَبِي هُرَيْرَةَ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏"‏ إِنَّ اللَّهَ خَلَقَ الْخَلْقَ حَتَّى إِذَا فَرَغَ مِنْ خَلْقِهِ، قَالَتِ الرَّحِمُ هَذَا مَقَامُ الْعَائِذِ بِكَ مِنَ الْقَطِيعَةِ‏.‏ قَالَ نَعَمْ أَمَا تَرْضَيْنَ أَنْ أَصِلَ مَنْ وَصَلَكِ‏.‏ وَأَقْطَعَ مَنْ قَطَعَكِ‏.‏ قَالَتْ بَلَى يَا رَبِّ‏.‏ قَالَ فَهْوَ لَكِ ‏"‏‏.‏ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏"‏ فَاقْرَءُوا إِنْ شِئْتُمْ ‏{‏فَهَلْ عَسَيْتُمْ إِنْ تَوَلَّيْتُمْ أَنْ تُفْسِدُوا فِي الأَرْضِ وَتُقَطِّعُوا أَرْحَامَكُمْ‏}‏‏"‏‏.‏
Reference : Sahih al-Bukhari 5987
In-book reference : Book 78, Hadith 18
USC-MSA web (English) reference : Vol. 8, Book 73, Hadith 16
  (deprecated numbering scheme)