Abdullaah bin Abbaas رضي الله عنه narrates that Rasulullaah صلى الله عليه و سلم sent a messenger with the invitation of lslaam to Wahshi bin Harb who was responsible for killing Hamza رضي الله عنه (the uncle of Rasulullaah صلى الله عليه و سلم ). The messenger returned with a message from Wahshi stating, "O Muhammad! How can you call me to Islaam when you say that a murderer, a Mushrikeen and an adulterer shall meet with a grave punishment and this punishment will be multiplied for them on the Day of Qiyaamah where they shall remain disgraced in it forever(1). I have committed all of these crimes, so is there any scope for me?" Allaah then revealed the verse:
إِلَّا مَن تَابَ وَآمَنَ وَعَمِلَ عَمَلًا صَالِحًا فَأُولَٰئِكَ يُبَدِّلُ اللَّهُ سَيِّئَاتِهِمْ حَسَنَاتٍ ۗ وَكَانَ اللَّهُ غَفُورًا رَّحِيمًا
Except for those who repent, believe and do righteous work. For them Allah will replace their evil deeds with good. And ever is Allah Forgiving and Merciful.(2)
In reply to this verse, Wahshi said, "0 Muhammad! The condition in this verse is uncompromising which states, 'Except for those who (sincere&) repent, accept Imaan and perform good actions.' What if I do not have the opportunity to fulfil it?" Allaah then revealed the verse:
إِنَّ اللَّهَ لَا يَغْفِرُ أَن يُشْرَكَ بِهِ وَيَغْفِرُ مَا دُونَ ذَٰلِكَ لِمَن يَشَاءُ
Indeed, Allah does not forgive association with Him, but He forgives what is less than that for whom He wills.(3)
To this, Wahshi replied, "This forgiveness depends on the will of Allaah. I do not know whether I shall be forgiven or not. Is there any other scope for me?" Allaah then revealed the verse:
قُلْ يَا عِبَادِيَ الَّذِينَ أَسْرَفُوا عَلَىٰ أَنفُسِهِمْ لَا تَقْنَطُوا مِن رَّحْمَةِ اللَّهِ ۚ إِنَّ اللَّهَ يَغْفِرُ الذُّنُوبَ جَمِيعًا ۚ إِنَّهُ هُوَ الْغَفُورُ الرَّحِيمُ
Say, "O My servants who have transgressed against themselves [by sinning], do not despair of the mercy of Allah . Indeed, Allah forgives all sins. Indeed, it is He who is the Forgiving, the Merciful." (4)
Upon hearing this, Wahshi said, 'Yes, this is in order." He then accepted Islaam. Other Muslims asked, "O Rasulullaah صلى الله عليه و سلم ! We had also committed the sins that Wahshi committed (Does this verse apply to us as well?)." Rasulullaah صلى الله عليه و سلم replied, "It applies to all Muslims in general." (Tabraani)
Footnotes:
(1) Surah al-Furqaan, ayaat 68-69
(2) Surah al-Furqaan, ayah 70
(3) Surah an-Nisaa', ayah 48
(4) Surah az-Zumar, ayah 53
[Source: Hayaat as-Sahaabah]