Answered by Shaykh Faraz Rabbani
Can you please talk about the tradition of praying two rakats before one is to be executed. I know someone who converted in prison, and is wrongly sentenced to execution (for a crime that he didn’t commit).
In the Name of Allah, Most Merciful and Compassionate
May Allah’s peace and blessings be upon His Messenger Muhammad, his folk, companions, and followers
May Allah grant your friend and us all ease and well-being, and all good in this life and the next.
In Radd al-Muhtar, Ibn Abidin relates from Imam Sarakhsi’s Sharh al-Siyar al-Kabir that, “If a Muslim is tested by execution, it is recommended to perform two rakats and then seek Allah’s forgiveness, in order that one’s final actions be prayer and seeking forgiveness.” [Ibn Abidin, Radd al-Muhtar]
This is taken from the actions of Sayyiduna Khubayb (as mentioned in Sahih al-Bukhari and the works of Sunan and Prophetic biography). When he was about to be executed, he requested time to pray two rakats first. (Allah be pleased with him)
And Allah alone gives success.
قال ابن عابدين في رد المحتار:
…نص عليه الإمام السرخسي في شرح السير الكبير . وذكر أيضا أنه إذا ابتلي المسلم بالقتل يستحب أن يصلي ركعتين يستغفر الله تعالى بعدهما ليكون آخر عمله الصلاة والاستغفار .