عَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ اللَّهُمَّ إِنِّي أَتَّخِذُ عِنْدَكَ عَهْدًا لَنْ تُخْلِفَنِيهِ إِنَّمَا أَنَا بَشَرٌ فَأَيُّ الْمُؤْمِنِينَ آذَيْتُهُ أَوْ شَتَمْتُهُ أَوْ جَلَدْتُهُ أَوْ لَعَنْتُهُ فَاجْعَلْهَا لَهُ صَلَاةً وَزَكَاةً وَقُرْبَةً تُقَرِّبُهُ بِهَا يَوْمَ الْقِيَامَةِ
Syedna Abu Huraira (may Allah be pleased with him) narrates that the Messenger of Allah (peace and blessings be upon him) said: O Allah! I take a covenant from You, which You will never break. I am only a human being, so if I cause harm to any believer, or abuse him, or flog him, or curse him, then make that thing for him a means of mercy, purity, and nearness, through which You bring him close to Yourself on the Day of Resurrection.
Brief Explanation
Benefits: … How interesting it is that even the supplications against others (bad-du‘a) of the Mercy to the Worlds (rahmatu lil-‘alamin), sallallahu alayhi wa sallam, become a means of purification and cleansing, and a source of reward and recompense for others. In reality, this is the greatness and virtue of the one who has been granted the title "Mercy to the Worlds." Imam Muslim rahimahullah has established a chapter regarding a hadith related to this subject: When the Noble Prophet sallallahu alayhi wa sallam curses someone, or abuses or supplicates against someone, and that person is not deserving of it, then it becomes a means of purification, reward, and mercy for him.