Bulugh al-Maram, Book 9, Hadith 1240 (English)

Al-Bara bin 'Azib (RAA) narrated, ‘The Messenger of Allah ordained that the guarding of a garden is the responsibility of its owners during the day and the guarding of animals is the responsibility of their owners at night. However, the owners of the animals are responsible for any damage caused by their animals during the night (i.e. pay compensation for what they damaged of other’s property).’ Related by Ahmad and the four Imams except At-Tirmidhi. Ibn Hibban graded it as Sahih.

وَعَنْ اَلْبَرَاءِ بْنِ عَازِبٍ رَضِيَ اَللَّهُ عَنْهُمَا قَالَ: { قَضَى رَسُولُ اَللَّهِ ‏- صلى الله عليه وسلم ‏-أَنَّ حِفْظَ اَلْحَوَائِطِ بِالنَّهَارِ عَلَى أَهْلِهَا, وَأَنْ حِفْظَ اَلْمَاشِيَةِ بِاللَّيْلِ عَلَى أَهْلِهَا, وَأَنَّ عَلَى أَهْلِ اَلْمَاشِيَةِ مَا أَصَابَتْ مَاشِيَتُهُمْ بِاللَّيْلِ } رَوَاهُ أَحْمَدُ, وَالْأَرْبَعَةُ إِلَّا اَلتِّرْمِذِيُّ, 1‏.‏ وَصَحَّحَهُ اِبْنُ حِبَّانَ وَفِي إِسْنَادِهِ اِخْتِلَافٌ.‏ 2‏.‏ ‏1 ‏- كذا بالأصل، وفي "أ": "رواه الخمسة إلا الترمذي".‏‏2 ‏- صحيح.‏ والخلاف المشار إليه هو في وصله وإرساله، ولكنه جاء بسند صحيح موصول كما عند أبي داود وابن ماجه وغيرهما، وفي الأصل تفصيل لطرق الحديث.‏

sunnah.com

also referenced under: Book 9, Hadith 1212 (In-Book)