The Messenger of Allah ﷺ said, "Do not let your livestock and children out when the sun has set, until the darkness of the early night passes, for the devils are sent out when the sun sets until the darkness of the early night passes."
حدثنا هاشم بن القاسم حدثنا زهير حدثنا أبو الزبير
قال رسول الله ﷺ لا ترسلوا فواشيكم وصبيانكم إذا غابت الشمس حتى تذهب فحمة العشاء فإن الشيطان يبعث إذا غابت الشمس حتى تذهب فحمة العشاء
Its isnad is sahih, and it is in Muslim with its wording, 3/1595, no. 2013, via Zuhayr from him, in the Book of Drinks, on the command to cover vessels, and in Abu Dawud, 3/79, no. 2604, in the Book of Jihad, on the dislike of traveling in the early part of the night, and in Bayhaqi, 5/256, in the Book of Hajj, similarly.