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:17759Abū Muḥammad ʿAbdullāh b. Yūsuf > Abū Saʿīd b. al-Aʿrābī > Saʿdān b. Naṣr > Sufyān > ʿAmr > ʿIkrimah

[Machine] There were people in Mecca who had embraced Islam. When the people went out to Badr, they did not leave anyone except those who had embraced Islam. Those who had embraced Islam were killed and it was revealed about them in the Quran: "Indeed, those whom the angels take [in death] while wronging themselves..." [Quran 4:97] until His saying: "And it is not [possible] for them to find a way [to escape]." [Quran 4:98] A way of rising up to it and a path leading to the city. So the Muslims who were in Medina wrote to those who were in Mecca. When they received the letter, some people who had embraced Islam came out and the polytheists followed them and forced them until they gave them the test. Then Allah revealed about them: "Except for one who is forced [to renounce his religion] while his heart is secure in faith." [Quran 16:106]  

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

كَانَ نَاسٌ بِمَكَّةَ قَدْ أَقَرُّوا بِالْإِسْلَامِ فَلَمَّا خَرَجَ النَّاسُ إِلَى بَدْرٍ لَمْ يَبْقَ أَحَدٌ إِلَّا أَخْرَجُوهُ فَقُتِلَ أُولَئِكَ الَّذِينَ أَقَرُّوا بِالْإِسْلَامِ فَنَزَلَتْ فِيهِمْ {إِنَّ الَّذِينَ تَوَفَّاهُمُ الْمَلَائِكَةُ ظَالِمِي أَنْفُسِهِمْ} [النساء 97] إِلَى قَوْلِهِ {وَسَاءَتْ مَصِيرًا إِلَّا الْمُسْتَضْعَفِينَ مِنَ الرِّجَالِ وَالنِّسَاءِ وَالْوِلْدَانِ لَا يَسْتَطِيعُونَ حِيلَةً وَلَا يَهْتَدُونَ سَبِيلًا} [النساء 98] حِيلَةً نُهُوضًا إِلَيْهَا وَسَبِيلًا طَرِيقًا إِلَى الْمَدِينَةِ فَكَتَبَ الْمُسْلِمُونَ الَّذِينَ كَانُوا بِالْمَدِينَةِ إِلَى مَنْ كَانَ بِمَكَّةَ فَلَمَّا كُتِبَ إِلَيْهِمْ خَرَجَ نَاسٌ مِمَّنْ أَقَرُّوا بِالْإِسْلَامِ فَاتَّبَعَهُمُ الْمُشْرِكُونَ فَأَكْرَهُوهُمْ حَتَّى أَعْطَوْهُمُ الْفِتْنَةَ فَأَنْزَلَ اللهُ ﷻ فِيهِمْ {إِلَّا مَنْ أُكْرِهَ وَقَلْبُهُ مُطْمَئِنٌّ بِالْإِيمَانِ} [النحل 106]