Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:16:119

Then, indeed your Lord, to those who have done wrong out of ignorance and then repent after that and correct themselves - indeed, your Lord, thereafter, is Forgiving and Merciful.  

Then indeed your Lord — to those who did evil, associating others ˹with God˺, out of ignorance, and then repented, returned ˹to God’s way˺, after that and made amends, in their actions — indeed your Lord after that, that is, ˹after˺ that ignorance, or that repentance, is Forgiving, of them, Merciful, to them.
القرآن:١٦:١١٩

ثُمَّ إِنَّ رَبَّكَ لِلَّذِينَ عَمِلُوا السُّوءَ بِجَهَالَةٍ ثُمَّ تَابُوا مِنْ بَعْدِ ذَٰلِكَ وَأَصْلَحُوا إِنَّ رَبَّكَ مِنْ بَعْدِهَا لَغَفُورٌ رَحِيمٌ  

{ثم إن ربك للذين عملوا السوء} الشرك {بجهالة ثم تابوا} رجعوا {من بعد ذلك وأصلحوا} عملهم {إن ربك من بعدها} أي الجهالة أو التوبة {لغفور} لهم {رحيم} بهم.

See similar narrations below:

Collected by Qurʾān, Bayhaqī
quran:7:153

But those who committed misdeeds and then repented after them and believed - indeed your Lord, thereafter, is Forgiving and Merciful.  

But those who commit evil deeds and repent, desist from them, thereafter and believe, in God — indeed your Lord thereafter, that is, after repentance, is truly Forgiving, Merciful’, towards them.
القرآن:٧:١٥٣

وَالَّذِينَ عَمِلُوا السَّيِّئَاتِ ثُمَّ تَابُوا مِنْ بَعْدِهَا وَآمَنُوا إِنَّ رَبَّكَ مِنْ بَعْدِهَا لَغَفُورٌ رَحِيمٌ  

{والذين عملوا السيَّئات ثم تابوا} رجعوا عنها {من بعدها وآمنوا} بالله {إن ربَّك من بعدها} أي التوبة {لغفور} لهم {رحيم} بهم.
quran:16:110

Then, indeed your Lord, to those who emigrated after they had been compelled ˹to renounce their religion˺ and thereafter fought ˹for the cause of Allah˺ and were patient - indeed, your Lord, after that, is Forgiving and Merciful  

Then indeed your Lord — as for those who emigrated, to Medina, after they were persecuted, ˹after˺ they were tortured and ˹compelled to˺ pronounce ˹words of˺ unbelief (a variant reading ˹for futinū, ‘they were persecuted’˺ has fatanū, in other words, ‘˹after˺ they disbelieved’, or ‘˹after˺ they turned people away from belief’), and then struggled and were patient, in obedience — indeed your Lord after that, that is, ˹after˺ such a trial, is Forgiving, of them, Merciful, to them (the predicate of the first inna, ‘indeed’, is indicated by the predicate of the second one).
القرآن:١٦:١١٠

ثُمَّ إِنَّ رَبَّكَ لِلَّذِينَ هَاجَرُوا مِنْ بَعْدِ مَا فُتِنُوا ثُمَّ جَاهَدُوا وَصَبَرُوا إِنَّ رَبَّكَ مِنْ بَعْدِهَا لَغَفُورٌ رَحِيمٌ  

{ثم إن ربك للذين هاجروا} إلى المدينة {من بعد ما فُتنوا} عذبوا وتلفظوا بالكفر وفي قراءة بالبناء للفاعل أي كفروا أو فتنوا الناس عن الأيمان {ثم جاهدوا وصبروا} على الطاعة {إن ربك من بعدها} أي الفتنة {لغفور} لهم {رحيم} بهم وخبر إن الأولى دل عليه خبر الثانية.
bayhaqi:13885Muḥammad b. ʿAbdullāh al-Ḥāfiẓ And ʿUbayd b. Muḥammad > Abū al-ʿAbbās Muḥammad b. Yaʿqūb > Yaḥyá b. Abū Ṭālib > ʿAbd al-Wahhāb > Saʿīd > Qatādah > ʿAzrah > al-Ḥasan al-ʿUranī > ʿAlqamah b. Qays > a man Atá Ibn Masʿūd > a man Zaná Biāmraʾah Thum Tābā Waʾaṣlaḥā Alah

[Machine] "That he may marry her? So he recited this verse, 'Then indeed your Lord, to those who have done evil out of ignorance and then repent after that and correct themselves - indeed, your Lord, thereafter, is Forgiving and Merciful.' [Surah An-Nahl: 119] He repeated it to him multiple times until he thought that he had given him permission in it."  

البيهقي:١٣٨٨٥أَخْبَرَنَا مُحَمَّدُ بْنُ عَبْدِ اللهِ الْحَافِظُ وَعُبَيْدُ بْنُ مُحَمَّدٍ قَالَا ثنا أَبُو الْعَبَّاسِ مُحَمَّدُ بْنُ يَعْقُوبَ ثنا يَحْيَى بْنُ أَبِي طَالِبٍ أنبأ عَبْدُ الْوَهَّابِ أنبأ سَعِيدٌ عَنْ قَتَادَةَ عَنْ عَزْرَةَ عَنِ الْحَسَنِ الْعُرَنِيِّ عَنْ عَلْقَمَةَ بْنِ قَيْسٍ أَنَّ رَجُلًا أَتَى ابْنَ مَسْعُودٍ ؓ فَقَالَ رَجُلٌ زَنَى بِامْرَأَةٍ ثُمَّ تَابَا وَأَصْلَحَا أَلَهُ

أَنْ يَتَزَوَّجَهَا؟ فَتَلَا هَذِهِ الْآيَةَ {ثُمَّ إِنَّ رَبَّكَ لِلَّذِينَ عَمِلُوا السُّوءَ بِجَهَالَةٍ ثُمَّ تَابُوا مِنْ بَعْدِ ذَلِكَ وَأَصْلَحُوا إِنَّ رَبَّكَ مِنْ بَعْدِهَا لَغَفُورٌ رَحِيمٌ} [النحل 119] قَالَ فَرَدَّدَهَا عَلَيْهِ مِرَارًا حَتَّى ظَنَّ أَنَّهُ قَدْ رَخَّصَ فِيهَا