It is narrated from Sa'id bin al-Musayyib and Hizam bin Sa'd bin Muhayyisah, may Allah have mercy on them, that the she-camel of our master Bara' bin 'Azib, may Allah be pleased with him, damaged the garden of a certain people. So the Messenger of Allah, peace and blessings be upon him, gave the ruling that during the day, the responsibility of protection lies with the owners of the property/garden, whereas if the livestock cause damage at night, then the compensation is upon the owners of the livestock.
Hadith Referenceالسنن المأثورة / باب ما جاء في فدية الأذى / 498
Hadith Takhrijسنن ابن ماجه الاحكام، باب الحكم فيما أفسدت المواشي، رقم: 2332 وقال الالباني: صحيح، مسند احمد: 101/39، رقم: 23694، السنن الكبرى للبيهقي: 342/8