Abu Hurairah reported,

The Messenger of Allah ﷺ said, "A man who had never done a single good deed said to his family, 'When I die, burn my body, then scatter half of my ashes on the land and half in the sea. By Allah, if Allah gets hold of me, He will punish me with a punishment He has never inflicted on anyone in all the worlds.'When the man died, his family did as he had instructed. Allah then commanded the land, and it gathered what was in it, and He commanded the sea, and it gathered what was in it. Then Allah asked him, 'Why did you do this?'He replied, 'Out of fear of You, my Lord, and You know best.'So Allah forgave him."

Muslim 6980

Sahih

حدثني محمد بن مرزوق بن بنت مهدي بن ميمون حدثنا روح حدثنا مالك عن أبي الزناد عن الأعرج

عن أبي هريرة

أن رسول الله ﷺ قال قال رجل لم يعمل حسنة قط لأهله إذا مات فحرقوه ثم اذروا نصفه في البر ونصفه في البحر فوالله لئن قدر الله عليه ليعذبنه عذابا لا يعذبه أحدا من العالمين فلما مات الرجل فعلوا ما أمرهم فأمر الله البر فجمع ما فيه وأمر البحر فجمع ما فيه ثم قال لم فعلت هذا قال من خشيتك يا رب وأنت أعلم فغفر الله له

مسلم 6980صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Tawba
Chapter
Vastness of Allah's mercy and that it precedes His wrath
Numbering
Darussalam 6980
Muslim 6980