Sahih al-Bukhari, Volume 6, Book 60, Hadith 288 (USC-MSA)

Narrated Sa`id bin Jubair: Ibn Abza said to me, "Ask Ibn `Abbas regarding the Statement of Allah: 'And whoever murders a believer intentionally, his recompense is Hell.' (4.69) And also His Statement: '...nor kill such life as Allah has forbidden, except for a just cause.....except those who repent, believe, and do good deeds.' " (25.68-70) So I asked Ibn `Abbas and he said, "When this (25.68-69) was revealed, the people of Mecca said, "We have invoked other gods with Allah, and we have murdered such lives which Allah has made sacred, and we have committed illegal sexual intercourse. So Allah revealed: 'Except those who repent, believe, and do good deeds and Allah is Oft-Forgiving, Most Merciful.' (25.70)

حَدَّثَنَا سَعْدُ بْنُ حَفْصٍ، حَدَّثَنَا شَيْبَانُ، عَنْ مَنْصُورٍ، عَنْ سَعِيدِ بْنِ جُبَيْرٍ، قَالَ قَالَ ابْنُ أَبْزَى سَلِ ابْنَ عَبَّاسٍ عَنْ قَوْلِهِ تَعَالَى ‏{‏وَمَنْ يَقْتُلْ مُؤْمِنًا مُتَعَمِّدًا فَجَزَاؤُهُ جَهَنَّمُ‏}‏ وَقَوْلِهِ ‏{‏لاَ يَقْتُلُونَ النَّفْسَ الَّتِي حَرَّمَ اللَّهُ إِلاَّ بِالْحَقِّ‏}‏ حَتَّى بَلَغَ ‏{‏إِلاَّ مَنْ تَابَ‏}‏ فَسَأَلْتُهُ فَقَالَ لَمَّا نَزَلَتْ قَالَ أَهْلُ مَكَّةَ فَقَدْ عَدَلْنَا بِاللَّهِ وَقَتَلْنَا النَّفْسَ الَّتِي حَرَّمَ اللَّهُ إِلاَّ بِالْحَقِّ وَأَتَيْنَا الْفَوَاحِشَ، فَأَنْزَلَ اللَّهُ ‏{‏إِلاَّ مَنْ تَابَ وَآمَنَ وَعَمِلَ عَمَلاً صَالِحًا‏}‏ إِلَى قَوْلِهِ ‏{‏غَفُورًا رَحِيمًا‏}‏

sunnah.com