The Messenger of Allah ﷺ said, "Whoever leaves behind wealth, it belongs to his heirs. Whoever leaves behind a debt or dependents, their care falls upon me and is my responsibility, for I am closer to the believers than they are to themselves."
حدثنا علي بن محمد حدثنا وكيع حدثنا سفيان عن جعفر بن محمد عن أبيه
قال رسول الله ﷺ من ترك مالا فلورثته ومن ترك دينا أو ضياعا فعلي وإلي وأنا أولى بالمؤمنين
[Sahih] Abu Dawud reported it in al-Kharaj, the chapter on the provisions of offspring, no. 2954, from the hadith of Sufyan Thawri through this route, and Ibn Hibban graded it sahih. Muslim also reported it, no. 867, through another route from Jafar bin Muhammad through this route.