Hadith on Thoughts: Allah forgives evil thoughts not acted upon

Abu Huraira reported: When the verse was revealed to the Messenger of Allah, peace and blessings be upon him, “Unto Allah belongs whatever is in the heavens and the earth, whether you reveal what is within yourselves or hide it, Allah will hold you accountable for it, as He forgives whomever He wills and punishes whomever He wills, for He has power over all things,” (2:284). This was hard on the Messenger of Allah’s companions so they came to him, knelt before him, and they said, “O Messenger of Allah, “We are held responsible for deeds we can accomplish, such as prayer, fasting, jihad, and charity, but this verse was revealed to you and we cannot live up to it.” Then, Allah revealed as a result, “The Messenger has faith in what has been revealed to him, as do the believers. Each of them believes in Allah, His angels, His books, and His messengers. They make no distinction between any of His messengers. They say, ‘We listen and we obey, we ask Your forgiveness our Lord and unto You is the final destination.’ Allah does not hold a soul accountable except what is within its power. It will be rewarded for what it has earned and taken to account for what it has earned. Our Lord, do not blame us if we forget or err. Our Lord, do not burden us as You have burdened those before us. Our Lord, do not overwhelm us with what we cannot endure. Pardon us, forgive us, and have mercy upon us. You are our guardian, so support us against the people who disbelieve.” (2:285)

Source: Ṣaḥīḥ Muslim 125

Grade: Sahih (authentic) according to Muslim

عَنْ ‌أَبِي هُرَيْرَةَ قَالَ لَمَّا نَزَلَتْ عَلَى رَسُولِ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ لِلهِ مَا فِي السَّمَاوَاتِ وَمَا فِي الأَرْضِ وَإِنْ تُبْدُوا مَا فِي أَنْفُسِكُمْ أَوْ تُخْفُوهُ يُحَاسِبْكُمْ بِهِ اللهُ فَيَغْفِرُ لِمَنْ يَشَاءُ وَيُعَذِّبُ مَنْ يَشَاءُ وَاللهُ عَلَى كُلِّ شَيْءٍ قَدِيرٌ فَاشْتَدَّ ذَلِكَ عَلَى أَصْحَابِ رَسُولِ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ فَأَتَوْا رَسُولَ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ ثُمَّ بَرَكُوا عَلَى الرُّكَبِ فَقَالُوا أَيْ رَسُولَ اللهِ كُلِّفْنَا مِنَ الْأَعْمَالِ مَا نُطِيقُ الصَّلَاةَ وَالصِّيَامَ وَالْجِهَادَ وَالصَّدَقَةَ وَقَدْ أُنْزِلَتْ عَلَيْكَ هَذِهِ الْآيَةُ وَلَا نُطِيقُهَا فَأَنْزَلَ اللهُ فِي إِثْرِهَا آمَنَ الرَّسُولُ بِمَا أُنْزِلَ إِلَيْهِ مِنْ رَبِّهِ وَالْمُؤْمِنُونَ كُلٌّ آمَنَ بِاللهِ وَمَلائِكَتِهِ وَكُتُبِهِ وَرُسُلِهِ لا نُفَرِّقُ بَيْنَ أَحَدٍ مِنْ رُسُلِهِ وَقَالُوا سَمِعْنَا وَأَطَعْنَا غُفْرَانَكَ رَبَّنَا وَإِلَيْكَ الْمَصِيرُ لَا يُكَلِّفُ اللَّهُ نَفْسًا إِلَّا وُسْعَهَا لَهَا مَا كَسَبَتْ وَعَلَيْهَا مَا اكْتَسَبَتْ رَبَّنَا لَا تُؤَاخِذْنَا إِن نَّسِينَا أَوْ أَخْطَأْنَا رَبَّنَا وَلَا تَحْمِلْ عَلَيْنَا إِصْرًا كَمَا حَمَلْتَهُ عَلَى الَّذِينَ مِن قَبْلِنَا رَبَّنَا وَلَا تُحَمِّلْنَا مَا لَا طَاقَةَ لَنَا بِهِ وَاعْفُ عَنَّا وَاغْفِرْ لَنَا وَارْحَمْنَا أَنتَ مَوْلَانَا فَانصُرْنَا عَلَى الْقَوْمِ الْكَافِرِينَ

125 صحيح مسلم كتاب الإيمان باب بيان قوله تعالى وإن تبدوا ما في أنفسكم أو تخفوه