The Messenger of Allah ﷺ said, "A man wronged himself greatly through his sins. When death approached him, he gave instructions to his sons, saying, 'When I die, burn my body, then grind my remains to dust, then scatter the dust in the wind over the sea. By Allah, if my Lord gains power over me, He will punish me with a punishment unlike any He has inflicted on anyone.'So they did exactly that with him. Then Allah commanded the earth, 'Return what you have taken,' and there he stood.Allah asked him, 'What drove you to do what you did?'He replied, 'Fear of You, my Lord,' and because of that, Allah forgave him."
حدثنا محمد بن يحيى وإسحق بن منصور قالا حدثنا عبد الرزاق أنبأنا معمر قال قال الزهري ألا أحدثك بحديثين عجيبين أخبرني حميد بن عبد الرحمن
عن رسول الله ﷺ قال أسرف رجل على نفسه فلما حضره الموت أوصى بنيه فقال إذا أنا مت فأحرقوني ثم اسحقوني ثم ذروني في الريح في البحر فوالله لئن قدر علي ربي ليعذبني عذابا ما عذبه أحدا قال ففعلوا به ذلك فقال للأرض أدي ما أخذت فإذا هو قائم فقال له ما حملك على ما صنعت قال خشيتك أو مخافتك يا رب فغفر له لذلك
Bukhari narrated it in "Hadiths of the Prophets," chapter 54, hadith 3481, from the report of Mamar, transmitted this way, and Muslim narrated it in "Repentance," the chapter on the vastness of Allah's mercy and that it overcomes His wrath, hadith 2a/2756, from the report of Abdul-Razzaq, transmitted this way.