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.
bayhaqi:17757Abū ʿAbdullāh > Abū al-ʿAbbās > Aḥmad > Yūnus > Ibn Isḥāq > Ḥakīm b. Jubayr > Saʿīd b. Jubayr > Ibn ʿAbbās

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 (Using translation from Qurʾān 16:110)   

البيهقي:١٧٧٥٧وَأَخْبَرَنَا أَبُو عَبْدِ اللهِ ثنا أَبُو الْعَبَّاسِ ثنا أَحْمَدُ ثنا يُونُسُ عَنِ ابْنِ إِسْحَاقَ حَدَّثَنِي حَكِيمُ بْنُ جُبَيْرٍ عَنْ سَعِيدِ بْنِ جُبَيْرٍ عَنِ ابْنِ عَبَّاسٍ ؓ قَالَ

أُنْزِلَتْ هَذِهِ الْآيَةُ فِيمَنْ كَانَ يُفْتَنُ مِنْ أَصْحَابِ رَسُولِ اللهِ ﷺ بِمَكَّةَ {ثُمَّ إِنَّ رَبَّكَ لِلَّذِينَ هَاجَرُوا مِنْ بَعْدِ مَا فُتِنُوا ثُمَّ جَاهَدُوا وَصَبَرُوا إِنَّ رَبَّكَ مِنْ بَعْدِهَا لَغَفُورٌ رَحِيمٌ} [النحل 110]  


See similar narrations below:

Collected by Qurʾān
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).
القرآن:١٦:١١٠

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

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