Muwatta Malik, Book 36, Hadith 1440 (In-Book)

Yahya related to me from Malik from Ibn Shihab from Haram ibn Sad ibn Muhayyisa that a female camel of al-Bara ibn Azib entered the garden of a man and it did some damage to it. The Messenger of Allah, may Allah bless him and grant him peace, gave a judgement that the people of the garden were responsible for guarding it in the day, and the owner of the animals was liable for what the animals destroyed at night.

حَدَّثَنِي يَحْيَى، عَنْ مَالِكٍ، عَنِ ابْنِ شِهَابٍ، عَنْ حَرَامِ بْنِ سَعْدِ بْنِ مُحَيِّصَةَ، أَنَّ نَاقَةً، لِلْبَرَاءِ بْنِ عَازِبٍ دَخَلَتْ حَائِطَ رَجُلٍ فَأَفْسَدَتْ فِيهِ فَقَضَى رَسُولُ اللَّهِ صلى الله عليه وسلم أَنَّ عَلَى أَهْلِ الْحَوَائِطِ حِفْظَهَا بِالنَّهَارِ وَأَنَّ مَا أَفْسَدَتِ الْمَوَاشِي بِاللَّيْلِ ضَامِنٌ عَلَى أَهْلِهَا ‏.‏

sunnah.com

also referenced under: Book 36, Hadith 37 (USC-MSA)