Sunan an-Nasa'i, Book 21, Hadith 264 (In-Book)

It was narrated from Hudhaifah that the Messenger of Allah said: "There was a man among those who came before you who thought badly of his deeds, so when death was approaching he said to his family: 'When I am dead, burn my body and grind up my bones, then scatter me in the sea, for if Allah gets hold of me, He will never forgive me.' But Allah commanded the angles to seize his soul. He said to him: 'What made you do what you did?' He said:: 'O Lord, I only did it because I feared You.' So Allah forgave him."

أَخْبَرَنَا إِسْحَاقُ بْنُ إِبْرَاهِيمَ، قَالَ حَدَّثَنَا جَرِيرٌ، عَنْ مَنْصُورٍ، عَنْ رِبْعِيٍّ، عَنْ حُذَيْفَةَ، عَنْ رَسُولِ اللَّهِ صلى الله عليه وسلم قَالَ ‏ "‏ كَانَ رَجُلٌ مِمَّنْ كَانَ قَبْلَكُمْ يُسِيءُ الظَّنَّ بِعَمَلِهِ فَلَمَّا حَضَرَتْهُ الْوَفَاةُ قَالَ لأَهْلِهِ إِذَا أَنَا مُتُّ فَأَحْرِقُونِي ثُمَّ اطْحَنُونِي ثُمَّ اذْرُونِي فِي الْبَحْرِ فَإِنَّ اللَّهَ إِنْ يَقْدِرْ عَلَىَّ لَمْ يَغْفِرْ لِي ‏.‏ قَالَ فَأَمَرَ اللَّهُ عَزَّ وَجَلَّ الْمَلاَئِكَةَ فَتَلَقَّتْ رُوحَهُ قَالَ لَهُ مَا حَمَلَكَ عَلَى مَا فَعَلْتَ قَالَ يَا رَبِّ مَا فَعَلْتُ إِلاَّ مِنْ مَخَافَتِكَ ‏.‏ فَغَفَرَ اللَّهُ لَهُ ‏" ‏ ‏.‏

sunnah.com