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:5:33

Indeed, the penalty for those who wage war against Allah and His Messenger and strive upon earth ˹to cause˺ corruption is none but that they be killed or crucified or that their hands and feet be cut off from opposite sides or that they be exiled from the land. That is for them a disgrace in this world; and for them in the Hereafter is a great punishment,  

The following was revealed when the ‘Arniyyūn came to Medina suffering from some illness, and the Prophet (s) gave them permission to go and drink from the camels’ urine and milk. Once they felt well they slew the Prophet’s shepherd and stole the herd of camels: Truly the only requital of those who fight against God and His Messenger, by fighting against Muslims, and hasten about the earth to do corruption there, by waylaying, is that they shall be slaughtered, or crucified, or have their hands and feet cut off on opposite sides, that is, their right hands and left feet, or be banished from the land (the aw, ‘or’, is ˹used˺ to indicate the ˹separate˺ application of ˹each of˺ the cases ˹listed˺; thus, death is for those that have only killed; crucifixion is for those that have killed and stolen property; the cutting off ˹of limbs on opposite sides˺ is for those that have stolen property but have not killed; while banishment is for those that pose a threat — this was stated by Ibn ‘Abbās and is the opinion of al-Shāfi‘ī; the more sound of his ˹al-Shāfi‘ī’s˺ two opinions is that crucifixion should be for three days after ˹the˺ death ˹of the killer˺, or, it is also said, shortly before ˹he is killed˺; with banishment are included similar punishments, such as imprisonment and the like). That, mentioned requital, is a degradation, a humiliation, for them in this world; and in the Hereafter theirs will be a great chastisement, namely, the chastisement of the Fire.
القرآن:٥:٣٣

إِنَّمَا جَزَاءُ الَّذِينَ يُحَارِبُونَ اللَّهَ وَرَسُولَهُ وَيَسْعَوْنَ فِي الْأَرْضِ فَسَادًا أَنْ يُقَتَّلُوا أَوْ يُصَلَّبُوا أَوْ تُقَطَّعَ أَيْدِيهِمْ وَأَرْجُلُهُمْ مِنْ خِلَافٍ أَوْ يُنْفَوْا مِنَ الْأَرْضِ ۚ ذَٰلِكَ لَهُمْ خِزْيٌ فِي الدُّنْيَا ۖ وَلَهُمْ فِي الْآخِرَةِ عَذَابٌ عَظِيمٌ  

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

See similar narrations below:

Collected by Abū Dāwūd
abudawud:4372Aḥmad b. Muḥammad b. Thābit > ʿAlī b. Ḥusayn from his father > Yazīd al-Naḥwī > ʿIkrimah > Ibn ʿAbbās

The verse "The punishment of those who wage war against Allah and His Apostle, and strive with might and main for mischief through the land is execution, or crucifixion, or the cutting off of hands and feet from opposite side or exile from the land...most merciful" was revealed about polytheists. If any of them repents before they are arrested, it does not prevent from inflicting on him the prescribed punishment which he deserves.  

أبو داود:٤٣٧٢حَدَّثَنَا أَحْمَدُ بْنُ مُحَمَّدِ بْنِ ثَابِتٍ حَدَّثَنَا عَلِيُّ بْنُ حُسَيْنٍ عَنْ أَبِيهِ عَنْ يَزِيدَ النَّحْوِيِّ عَنْ عِكْرِمَةَ عَنِ ابْنِ عَبَّاسٍ قَالَ

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